Click here to Skip to main content
15,897,273 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Login through HttpWebRequest? Pin
Dave Kreskowiak9-May-08 9:56
mveDave Kreskowiak9-May-08 9:56 
GeneralRe: Login through HttpWebRequest? Pin
AliAmjad9-May-08 10:20
AliAmjad9-May-08 10:20 
GeneralRe: Login through HttpWebRequest? Pin
Dave Kreskowiak9-May-08 10:39
mveDave Kreskowiak9-May-08 10:39 
GeneralRe: Login through HttpWebRequest? Pin
AliAmjad9-May-08 22:35
AliAmjad9-May-08 22:35 
GeneralRe: Login through HttpWebRequest? Pin
Dave Kreskowiak10-May-08 5:49
mveDave Kreskowiak10-May-08 5:49 
GeneralRe: Login through HttpWebRequest? Pin
AliAmjad12-May-08 1:31
AliAmjad12-May-08 1:31 
QuestionCreating Button's Dynamicaly Pin
jacko8739-May-08 7:37
jacko8739-May-08 7:37 
AnswerRe: Creating Button's Dynamicaly Pin
Dave Kreskowiak9-May-08 7:48
mveDave Kreskowiak9-May-08 7:48 
You create button the same way you create an instance of any other class, with New. You then set a bunch of properties on the button for size, location, Text, whatever, ... Then you add the button to the container form's Controls collection.
Dim newButton As New Button
newButton.Location = New Point(x, y)
newButton.Size = New Size(50, 75)
newButton.Text = someText
Me.Controls.Add(newButton)

Next, you have to wire up the button's Click event so you can get notified when the user clicks on it. That you do with the AddHandler statement:
AddHandler newButton.Click, AddressOf myButtonClickHandler

Of course, myButtonClickHandler has to have the signature of the appropriate event handler:
Private Sub myButtonClickHandler(ByVal sender As System.Object, ByVal e As System.EventArgs)
    ... code to handle the button click goes here
End Sub

Multiple buttons can be wired up to the same event handler.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




GeneralRe: Creating Button's Dynamicaly [modified] Pin
jacko8739-May-08 8:02
jacko8739-May-08 8:02 
GeneralRe: Creating Button's Dynamicaly Pin
Dave Kreskowiak9-May-08 8:39
mveDave Kreskowiak9-May-08 8:39 
QuestionRe: Creating Button's Dynamicaly Pin
jacko8739-May-08 9:29
jacko8739-May-08 9:29 
AnswerRe: Creating Button's Dynamicaly Pin
Dave Kreskowiak9-May-08 9:57
mveDave Kreskowiak9-May-08 9:57 
GeneralRe: Creating Button's Dynamicaly Pin
jacko8739-May-08 10:13
jacko8739-May-08 10:13 
GeneralRe: Creating Button's Dynamicaly Pin
DanB19839-May-08 10:37
DanB19839-May-08 10:37 
GeneralRe: Creating Button's Dynamicaly Pin
Dave Kreskowiak9-May-08 10:41
mveDave Kreskowiak9-May-08 10:41 
QuestionVBA Help, probs really simple Pin
harveyhanson9-May-08 2:21
harveyhanson9-May-08 2:21 
AnswerRe: VBA Help, probs really simple Pin
parth.p9-May-08 2:56
parth.p9-May-08 2:56 
QuestionSelect subset of records from .xml Pin
cstrader2329-May-08 1:40
cstrader2329-May-08 1:40 
AnswerRe: Select subset of records from .xml Pin
Dave Kreskowiak9-May-08 3:27
mveDave Kreskowiak9-May-08 3:27 
GeneralRe: Select subset of records from .xml Pin
cstrader2329-May-08 6:07
cstrader2329-May-08 6:07 
GeneralRe: Select subset of records from .xml Pin
Dave Kreskowiak9-May-08 7:40
mveDave Kreskowiak9-May-08 7:40 
QuestionHelp with Linq in VB.net Pin
Chinners9-May-08 0:24
Chinners9-May-08 0:24 
AnswerRe: Help with Linq in VB.net Pin
Guffa9-May-08 2:14
Guffa9-May-08 2:14 
GeneralRe: Help with Linq in VB.net Pin
Chinners9-May-08 6:19
Chinners9-May-08 6:19 
GeneralRe: Help with Linq in VB.net Pin
Guffa9-May-08 7:16
Guffa9-May-08 7:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.