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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

triggering an event when a form is open 1

Status
Not open for further replies.

imjbhowe

IS-IT--Management
Jul 26, 2001
18
0
0
US
I am trying to trigger an event when a form is open.

I am using sub form_load() ' it is near the end of the code.

Here is all the code. I have already tried using sub form1_load() as well but that doesn't work.

Thanks in advance.

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
Me.Text = &quot;Form1&quot;
End Sub

#End Region
Sub form_load()
MsgBox(&quot;howdy&quot;)
End Sub

End Class
 
This is what mine looks like.
Private Sub frmSortGen_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

Get to the code window of your form. Select the left dropdown combobox and select (Base Class Events). Now select the right dropdown combobox and select Load. Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Thanks, that worked. I am still a very new to vb .net, I only have limites experience with vb 5. I need to get a book.

I appreciate the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top