Home All Groups Group Topic Archive Search About

A Bug in Visual Studio ?

Author
18 Mar 2005 7:41 PM
Halil Gursoy

I am unable to solve the problem. Any help is appreciated. Is this a bug?

Summary :
I am raising  a custom shared event from custom DateTimePicker instances.
This custom event causes to a call to MessageBox.Show. At that point splash
screen form which is the starting point of applicatioin pops up.

Details:
I have a winforms application, Vb.NET. I implemented a custom DateTimePicker
and overrided the OnFormClose method. Custom DateTimePicker has a shared
event "UnpermittedDate" .  This event is raised at overriden OnFormClose
Method of custom DateTimePicker.

One of the windows forms handles the shared event raised by each custom
DateTimePicker as follows;

Private Sub CustomDateTimePicker_UnPermittedDate()
            MessageBox.Show("End date must be after begin date")
        End Sub

To problem is whenever this messagebox pops up, the splash screen which is
the starting point of application pops up too. If there is no call to
MessageBox.show then there is no problem,

Here is the <non-user code> section at that point

    system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WmCloseUp(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x1a bytes   
    system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WmReflectCommand(System.Windows.Forms.Message
m = {System.Windows.Forms.Message}) + 0xbe bytes   
    system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x63 bytes   
    system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   
    system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes   
    system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int
hWnd = 984012, int msg = 8270, int wparam = 984012, int lparam = 1239464) +
0x3d bytes   
    system.windows.forms.dll!System.Windows.Forms.Control.SendMessage(int msg
= 8270, int wparam = 984012, int lparam = 1239464) + 0x48 bytes   
    system.windows.forms.dll!System.Windows.Forms.Control.ReflectMessageInternal(int
hWnd = 984012, System.Windows.Forms.Message m =
{System.Windows.Forms.Message}) + 0x7f bytes   
    system.windows.forms.dll!System.Windows.Forms.Control.WmNotify(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x2d bytes   
    system.windows.forms.dll!System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x664 bytes   
    system.windows.forms.dll!System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x6c bytes   
    system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   
    system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes   
    system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int
hWnd = 1246198, int msg = 78, int wparam = 984012, int lparam = 1239464) +
0x3d bytes   
    system.windows.forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xd4 bytes   
    system.windows.forms.dll!System.Windows.Forms.Control.DefWndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   
    system.windows.forms.dll!System.Windows.Forms.Control.WmMouseDown(System.Windows.Forms.Message
m = {System.Windows.Forms.Message}, System.Windows.Forms.MouseButtons button
= Left, int clicks = 1) + 0x4e bytes   
    system.windows.forms.dll!System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x484 bytes   
    system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x53 bytes   
    system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   
    system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes   
    system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int
hWnd = 984012, int msg = 513, int wparam = 1, int lparam = 196688) + 0x3d
bytes   
    system.windows.forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(int dwComponentID = 1, int reason = -1, int pvLoopData = 0) + 0x349 bytes   
    system.windows.forms.dll!ThreadContext.RunMessageLoopInner(int reason =
-1, System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x1f3 bytes   
    system.windows.forms.dll!ThreadContext.RunMessageLoop(int reason = -1,
System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x50 bytes   
    system.windows.forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm = {PAH_HerdHealthUI.frmSplashScreen}) + 0x34 bytes   
    PAH HerdHealthUI.exe!PAH_HerdHealthUI.frmSplashScreen.Main() Line 3 + 0x1d
bytes    Basic

Author
18 Mar 2005 8:59 PM
Cowboy (Gregory A. Beamer) - MVP
My first guess is you are not using the right event and your circumventing
the close is causing it to "reopen" the form.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

Show quoteHide quote
"Halil Gursoy" wrote:

> I am unable to solve the problem. Any help is appreciated. Is this a bug?
>
> Summary :
> I am raising  a custom shared event from custom DateTimePicker instances.
> This custom event causes to a call to MessageBox.Show. At that point splash
> screen form which is the starting point of applicatioin pops up.
>
> Details:
> I have a winforms application, Vb.NET. I implemented a custom DateTimePicker
> and overrided the OnFormClose method. Custom DateTimePicker has a shared
> event "UnpermittedDate" .  This event is raised at overriden OnFormClose
> Method of custom DateTimePicker.
>
> One of the windows forms handles the shared event raised by each custom
> DateTimePicker as follows;
>
>  Private Sub CustomDateTimePicker_UnPermittedDate()
>             MessageBox.Show("End date must be after begin date")
>         End Sub
>
> To problem is whenever this messagebox pops up, the splash screen which is
> the starting point of application pops up too. If there is no call to
> MessageBox.show then there is no problem,
>
> Here is the <non-user code> section at that point
>

>     system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WmCloseUp(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x1a bytes   

>     system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WmReflectCommand(System.Windows.Forms.Message
> m = {System.Windows.Forms.Message}) + 0xbe bytes   

>     system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x63 bytes   

>     system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   

>     system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes   

>     system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int
> hWnd = 984012, int msg = 8270, int wparam = 984012, int lparam = 1239464) +
> 0x3d bytes   
>      system.windows.forms.dll!System.Windows.Forms.Control.SendMessage(int msg
> = 8270, int wparam = 984012, int lparam = 1239464) + 0x48 bytes   

>     system.windows.forms.dll!System.Windows.Forms.Control.ReflectMessageInternal(int
> hWnd = 984012, System.Windows.Forms.Message m =
> {System.Windows.Forms.Message}) + 0x7f bytes   

>     system.windows.forms.dll!System.Windows.Forms.Control.WmNotify(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x2d bytes   

>     system.windows.forms.dll!System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x664 bytes   

>     system.windows.forms.dll!System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x6c bytes   

>     system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   

>     system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes   

>     system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int
> hWnd = 1246198, int msg = 78, int wparam = 984012, int lparam = 1239464) +
> 0x3d bytes   

>     system.windows.forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xd4 bytes   

>     system.windows.forms.dll!System.Windows.Forms.Control.DefWndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   

>     system.windows.forms.dll!System.Windows.Forms.Control.WmMouseDown(System.Windows.Forms.Message
> m = {System.Windows.Forms.Message}, System.Windows.Forms.MouseButtons button
> = Left, int clicks = 1) + 0x4e bytes   

>     system.windows.forms.dll!System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x484 bytes   

>     system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x53 bytes   

>     system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   

>     system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes   

>     system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int
> hWnd = 984012, int msg = 513, int wparam = 1, int lparam = 196688) + 0x3d
> bytes   

>     system.windows.forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(int dwComponentID = 1, int reason = -1, int pvLoopData = 0) + 0x349 bytes   
>      system.windows.forms.dll!ThreadContext.RunMessageLoopInner(int reason =
> -1, System.Windows.Forms.ApplicationContext context =
> {System.Windows.Forms.ApplicationContext}) + 0x1f3 bytes   
>      system.windows.forms.dll!ThreadContext.RunMessageLoop(int reason = -1,
> System.Windows.Forms.ApplicationContext context =
> {System.Windows.Forms.ApplicationContext}) + 0x50 bytes   

>     system.windows.forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm = {PAH_HerdHealthUI.frmSplashScreen}) + 0x34 bytes   
>      PAH HerdHealthUI.exe!PAH_HerdHealthUI.frmSplashScreen.Main() Line 3 + 0x1d
> bytes    Basic
>
>
>
>
>
>
Are all your drivers up to date? click for free checkup

Author
18 Mar 2005 11:45 PM
Halil Gursoy
Thank you for your post, Cowboy.

I checked the code which closes splash screen. It was - me.Finalize()

I changed the code as following

me.Visible= False
me.Finalize()

Now the splash screen doesn't pop up when the event is raised.

Thank you very much.


Show quoteHide quote
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ***************************
> Think Outside the Box!
> ***************************
Halil
..
"Cowboy (Gregory A. Beamer) - MVP" wrote:

> My first guess is you are not using the right event and your circumventing
> the close is causing it to "reopen" the form.
>
>
> ---
>

>
> "Halil Gursoy" wrote:
>
> > I am unable to solve the problem. Any help is appreciated. Is this a bug?
> >
> > Summary :
> > I am raising  a custom shared event from custom DateTimePicker instances.
> > This custom event causes to a call to MessageBox.Show. At that point splash
> > screen form which is the starting point of applicatioin pops up.
> >
> > Details:
> > I have a winforms application, Vb.NET. I implemented a custom DateTimePicker
> > and overrided the OnFormClose method. Custom DateTimePicker has a shared
> > event "UnpermittedDate" .  This event is raised at overriden OnFormClose
> > Method of custom DateTimePicker.
> >
> > One of the windows forms handles the shared event raised by each custom
> > DateTimePicker as follows;
> >
> >  Private Sub CustomDateTimePicker_UnPermittedDate()
> >             MessageBox.Show("End date must be after begin date")
> >         End Sub
> >
> > To problem is whenever this messagebox pops up, the splash screen which is
> > the starting point of application pops up too. If there is no call to
> > MessageBox.show then there is no problem,
> >
> > Here is the <non-user code> section at that point
> >
> > 
> >     system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WmCloseUp(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x1a bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WmReflectCommand(System.Windows.Forms.Message
> > m = {System.Windows.Forms.Message}) + 0xbe bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x63 bytes   
> > 
> >     system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   
> > 
> >     system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int
> > hWnd = 984012, int msg = 8270, int wparam = 984012, int lparam = 1239464) +
> > 0x3d bytes   
> >      system.windows.forms.dll!System.Windows.Forms.Control.SendMessage(int msg
> > = 8270, int wparam = 984012, int lparam = 1239464) + 0x48 bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.Control.ReflectMessageInternal(int
> > hWnd = 984012, System.Windows.Forms.Message m =
> > {System.Windows.Forms.Message}) + 0x7f bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.Control.WmNotify(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x2d bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x664 bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x6c bytes   
> > 
> >     system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   
> > 
> >     system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int
> > hWnd = 1246198, int msg = 78, int wparam = 984012, int lparam = 1239464) +
> > 0x3d bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xd4 bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.Control.DefWndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.Control.WmMouseDown(System.Windows.Forms.Message
> > m = {System.Windows.Forms.Message}, System.Windows.Forms.MouseButtons button
> > = Left, int clicks = 1) + 0x4e bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x484 bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.DateTimePicker.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x53 bytes   
> > 
> >     system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes   
> > 
> >     system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int
> > hWnd = 984012, int msg = 513, int wparam = 1, int lparam = 196688) + 0x3d
> > bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(int dwComponentID = 1, int reason = -1, int pvLoopData = 0) + 0x349 bytes   
> >      system.windows.forms.dll!ThreadContext.RunMessageLoopInner(int reason =
> > -1, System.Windows.Forms.ApplicationContext context =
> > {System.Windows.Forms.ApplicationContext}) + 0x1f3 bytes   
> >      system.windows.forms.dll!ThreadContext.RunMessageLoop(int reason = -1,
> > System.Windows.Forms.ApplicationContext context =
> > {System.Windows.Forms.ApplicationContext}) + 0x50 bytes   
> > 
> >     system.windows.forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm = {PAH_HerdHealthUI.frmSplashScreen}) + 0x34 bytes   
> >      PAH HerdHealthUI.exe!PAH_HerdHealthUI.frmSplashScreen.Main() Line 3 + 0x1d
> > bytes    Basic
> >
> >
> >
> >
> >
> >

Bookmark and Share