Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

Check a couple of things:

[*]Your event is still hooked up

[*]You're in Debug Mode (if you're testing with a breakpoint)

[*]You're setting a breakpoint right at the top of the event, not farther down (after a potential error)

[*]There are no errors in the constructor

[/list=1]

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
  • 8 months later...
Posted

Found a fix to this one as was having the same issue. There is a Q number on it with Microsoft:

 

http://support.microsoft.com/default.aspx?scid=kb;en-us;318386

 

Apperently an ActiveX control on a .Net form launched using showdialog will cause the form_load not to work. Strange but true.

 

Here's the code:

 

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

m_loaded = True ' remember we did it once

End If

MyBase.WndProc(m) ' delegate to the default window procedure

 

End Sub

 

 

QUESTION: Does anyone know what type

 

Const WM_SHOWWINDOW = &H18

 

is as I need to turn Option Strict Off to get this to work. Also if anyone can explain how this works that would help to.

 

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...