vincentnl Posted April 17, 2003 Posted April 17, 2003 I am using MSchart. Dragged it onto my form, and suddenly the form_load method isn;t reached any longer. How can this be? Quote
*Experts* Nerseus Posted April 17, 2003 *Experts* Posted April 17, 2003 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 Quote "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
Roey Posted January 14, 2004 Posted January 14, 2004 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 Quote
vincentnl Posted January 14, 2004 Author Posted January 14, 2004 Thanks for your reply. As it was 7 months ago, I have worked around it, but you suspected as much. Hope others will benefit from your find. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.