Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello World

Status
Not open for further replies.

seanbo

Programmer
Jun 6, 2003
407
GB
I've just started using Visual Studio.net and C#. I'm writting a HelloWorld app. I have A window with a button in it, when you press the button a message box appears with hello world in it. i use the method 'show' like this:

MessageBox.Show(this, "Hello World!", "Message");

the box appears in the middle of the screen, not over its parent, as i though 'this' would specify. how can i make it appear in the correct place?
 
There aren't any overloads for the .Show method to cause the MessageBox object to appear in a specific location (at least in the v1.0 docs I have). All it does is ensure that the dialog appears on top (ahead of the other window in the Z-order). Sorry.

But you could write your own small form that acted like the MessageBox that did you want.

Chip H.
 
i could indeed, and perhaps i should. cheers chip.

GoodMessageBox extends MessageBox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top