Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) Const WM_SHOWWINDOW = &H18 Static m_loaded As Boolean If m.Msg = WM_SHOWWINDOW Then ' The form is being loaded If Me.Modal And Not m_loaded Then ' the form is modal and this is the first time it is being loaded MyBase.OnLoad(New System.EventArgs()) End If ' remember we did it once m_loaded = True End If ' delegate to the default window procedure MyBase.WndProc(m) End Sub>
>The issue: > >I have a VB.NET Windows Form. This form is invoked from a DBI.NET calendar control. >If I invoke the form using <form>.Show, the load method of the form runs. >If I invoke the form using <form>.ShowDialog, the load method will not run. > >What gives? > >On this one form, it was working fine initially, I made a change to 'DIM' >a new variable, and bang, the load would no longer run if I invoked >the form with 'ShowDialog' > >Any help would be appreciated. > >SAA >