Windows Develop Bookmark and Share   
 index > Windows Forms General > messagebox.show strange behavior
 

messagebox.show strange behavior

I have an odd problem. It seems all of a sudden, within an app i am developing, all occuraances of messagebox.show is ignored

To test, i set the first line of my program to a messagebox.show and it never gets displayed.

There are no errors either at compile or run time. Intellisence doesnt work

when i type messagebox. i have to type it in full

Any ideas much appreciated

Chris Anderson

chrisanderson  Wednesday, August 22, 2007 10:00 AM

Does the messagebox actually display at runtime?

ARK88  Wednesday, August 22, 2007 12:12 PM
Getting both IntelliSense confused AND not seeing the message box is drastically strange. Try it in a little test project. Look for an identifier in your code that resembles "messagebox".
nobugz  Wednesday, August 22, 2007 12:59 PM

Thanks for your replies,

No, it doesnt show at any point in my app.

Ive tried a messagebox command on a new test project, and that works fine.

Im baffled

Regards

Chris

chrisanderson  Saturday, August 25, 2007 8:22 PM
>Look for an identifier in your code that resembles "messagebox".

Sorry, dont know what you mean?
chrisanderson  Saturday, August 25, 2007 8:24 PM
If you would have defined your own class "MessageBox", it would hide the one in the System.Windows.Forms namespace.
nobugz  Saturday, August 25, 2007 8:29 PM

Thanks for your reply,

no, i didnt define my own. Just used the standard system one.

The only thing i can think to do is to create a new project, and add bits to it one by one and test after each stage.

This will take some time, but cant think of anything else.

Thanks

Chris

chrisanderson  Sunday, August 26, 2007 2:12 PM
Hi,could you please paste some code,it is hard to say what's wrong with your application.

Gavin Jin - MSFT  Tuesday, August 28, 2007 2:39 AM

Ok guys, ive cracked this one. Thought i'd share this with you to avoid the problem.

After a LOT of testing, cups of coffee and head scrating I know what the problem is.

At the time i reported the problem, i had put my system, clock back (for some other purpose nothing to do with this issue - for this explpanation lets say 15/7/07). I had prevously complied my project to a later date lets say 15/8/07.

I then inserted a messagebox.show command in my code (while my clock was 15/7/07)to test something and as you know it didnt work. Thats because when i pressed F5 it was using the old exe, ie 15/8/07. Even doing a build would not regenerate the exe file until i put my system clock back to what it should be (eg 15/8/07)

No errors - no warning messages!

Is this a bug or some wierd 'feature' ??

Thanks to everyone who replied.

Chris Anderson

chrisanderson  Friday, August 31, 2007 12:44 PM
That would explain it. The builder decides what needs to be rebuild based on the timestamps of the source code file and the binary output file. Changing your clock messes that up. Doesn't explain IntelliSense problem though.
nobugz  Friday, August 31, 2007 12:53 PM

Thanks for the clarification.

The intellisense problem went away after a reboot - no idea why.

Thanks everyone for the replies

Its a wrap

Chris

chrisanderson  Friday, August 31, 2007 4:43 PM

You can use google to search for other answers

Custom Search

More Threads

• in Immeidate window it works but not on class- RTF-clipborad
• Adding LVS_NOCOLUMNHEADER support to ListView descendent
• Please help
• Getting controls under mouse pointer
• VS 2008 SP1 abstract Form/UserControl not working even when using Brian Pepin, Urban Potato, technique. Help...
• Report with bitmaps
• Killing a thread initiated by BeginInvoke()
• static gettype
• Creating applications
• error occuring in sqlserver sql statement in vb.net