A Bug in Visual Studio ?

G

Guest

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
 
G

Guest

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!
***************************
 
G

Guest

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.

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

***************************
Think Outside the Box!
***************************
Halil
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top