Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I write an Init()?

Status
Not open for further replies.

rshearin

Programmer
Jan 16, 2007
5
US
OK, by now you've already figured out that I am not a VBA programmer. However, I need to write one very basic form. I seem to have most of it working well but I can not figure out how to properly write an Init() and/or get it to run when I open the form that I am creating. I am using Visual Basic 2005 Express and clicking on Debug -> Start Debugging to get it to run. Here's the basic code with some of the meat taken out since it isn't related to the problem.

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(" Button1.Hide()
Button2.Show()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

Private Sub Init()
MsgBox("help me")
End Sub

End Class

How do I write Init() so that when I open the form, it gets called immediately?

Thanks in advance!
 
If you are using 2005 Express, then this is VB.NET 2.0, not VBA?

Try posting on the VB.NET forum...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top