When forms opens...

  • Thread starter Thread starter Sender
  • Start date Start date
S

Sender

In VB6 there is form_load event....what's the equivalent in VB.Net. I want
to write to code to checked=true or false for some of the Check Box controls
on the form...........and I want to write this code when form loads.....

Thanks in advance!
 
Hi Sender,

The form load event still exists...

Public Sub OnFormLoad(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load
...
End Sub

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
 
Sender said:
In VB6 there is form_load event....what's the equivalent in VB.Net. I want
to write to code to checked=true or false for some of the Check Box controls
on the form...........and I want to write this code when form loads.....

Thanks in advance!


Select the Load event too!
Just double-click the form, like VB6.....
 
I think I am missing very basic here...but I don't know what... For
example, if I start a new project with form1 and then I open form1.vb (code
window) and select "form1" in the first list box then I don't find
"form1_load" event. However, when I double-click the form (as suggested by
you) then automatically "form1_load" comes in the second list box. Could
you please tell why is that and what I am missing..

Thanks
 
Sender said:
In VB6 there is form_load event....what's the equivalent in VB.Net. I
want to write to code to checked=true or false for some of the Check
Box controls on the form...........and I want to write this code when
form loads.....

Use the Load event.
 
Sender said:
In VB6 there is form_load event....what's the equivalent in VB.Net. I want
to write to code to checked=true or false for some of the Check Box controls
on the form...........and I want to write this code when form loads.....

You can do this in the 'Load' event handler or in the constructor after
the call to 'InitializeComponent'.
 
Sender said:
I think I am missing very basic here...but I don't know what... For
example, if I start a new project with form1 and then I open form1.vb (code
window) and select "form1" in the first list box then I don't find
"form1_load" event. However, when I double-click the form (as suggested by
you) then automatically "form1_load" comes in the second list box. Could
you please tell why is that and what I am missing..

On the top border of the code editor you will find 2 comboboxes. Select
"base class events" in the left combobox, then select the event in the
right combobox.
 
I think I am missing very basic here...but I don't know what... For
example, if I start a new project with form1 and then I open form1.vb (code
window) and select "form1" in the first list box then I don't find
"form1_load" event. However, when I double-click the form (as suggested by
you) then automatically "form1_load" comes in the second list box. Could
you please tell why is that and what I am missing..

Thanks

You need to drop down the to the Form1 Events entry... In other words,
in the left hand drop down, you'll see something like:

Form1
(Overrides)
(Form1 Events)

Select the From1 events, and then the right hand drop down will contain
the event list :)

Tom Shelton
 
Same event occurs, in the VB.NET designer just double click on the form and
the form_load event will be created for you.
cheer
 
Back
Top