ok, tutorial lesson 1
- add a button and make it do something -
1/ drag a button onto your form, anywhere you want it to be
2/ modify the button to your needs (size, color, text..) When viewing the properties of the button you'll notice a lot of properties. You can modify these properties with the properties panel, but in fact, you can reach all of those properties by coding as well..
3/ example; create the button and NAME it button1 (will be default name)
4/ now, to make the button DO something, doubleclick the button on the form (in designtime). You'll see that the form code will be opened and a new EVENT method will be created (something like 'Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ')
5/ above event will actually handle what will happen if you click the button (watch the end of the event: HANDLES button1.click)
6/ in that event (between sub and end sub) you'll write your code or call the method to be used (for example the method provided in this thread) For this example, enter following code:
Hidden Content
You must
[To see links please register here]
or
[To see links please register here]
to view this content.
now build your exe or debug (press F5 in Visual Studio), click your button and enjoy your 'first' program
Try to play around now: Handles Button1.Click ==> remove the 'click' at the end and see all other events a button can handle by default...or call any other method with that or another button...