Hi,
My C# application (form based, winexe) displays MessageBoxes at certain
times. At the moment it centres them on the screen; I want them centered
on the application.
This version (below) of MessageBox.Show should do this for me but I
can't seem to work out what the 1st parameter should be.
public static DialogResult Show(
IWin32Window owner,
string text, string caption,
MessageBoxButtons buttons, MessageBoxIcon icon);
MessageBox.Show( ??WHAT-GOES-HERE??,
"Text", "Text", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
I can't work out what the 1st paramaters variable should be.
'this.Handle' does not work.
Thanks and regards,
Pirmin 2 8067
Havent test it but have you tried to add the Form of the main GUI in it?
Add
private Form mainform = new MyApp();
into the class
MessageBox.Show( mainform, "Text", "Text", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
"Pirmin G." <pi******@gmx.de> schrieb im Newsbeitrag
news:c6**********@zrha108x.zrh.siemens.ch... Hi,
My C# application (form based, winexe) displays MessageBoxes at certain times. At the moment it centres them on the screen; I want them centered on the application.
This version (below) of MessageBox.Show should do this for me but I can't seem to work out what the 1st parameter should be.
public static DialogResult Show( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon);
MessageBox.Show( ??WHAT-GOES-HERE??, "Text", "Text", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
I can't work out what the 1st paramaters variable should be. 'this.Handle' does not work.
Thanks and regards,
Pirmin
Pirmin G. wrote: Hi,
My C# application (form based, winexe) displays MessageBoxes at certain times. At the moment it centres them on the screen; I want them centered on the application.
This version (below) of MessageBox.Show should do this for me but I can't seem to work out what the 1st parameter should be.
public static DialogResult Show( IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon);
MessageBox.Show( ??WHAT-GOES-HERE??, "Text", "Text", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
I can't work out what the 1st paramaters variable should be. 'this.Handle' does not work.
Just pass this.
--
Tom Porterfield
MS-MVP MCE http://support.telop.org
Please post all follow-ups to the newsgroup only. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bill |
last post by:
For some reason, I have an errormessage popup that "blinks", but pops up
BEHIND the applications, which is confusing to users.
Is there any way to force it to the top?
|
by: Jeff Van Epps |
last post by:
We've been unable to get events working going from C# to VJ++. We
think that the C# component is being exposed properly as a
ConnectionPoint, and the Advise() from the VJ++ side seems to be...
|
by: chathurangakw |
last post by:
Hi ,
I'm working on a smart client application. In one of my forms I have a
socket instance which listens for any messages from others and there
are some other windows forms too.
when the...
|
by: Richard |
last post by:
Hi All,
I am using Visual C++ .Net to create a windows forms application and I am
getting the following errors when I do a MessageBox::Show in my Form1.cpp
file:
Form1.cpp(19): error C2653:...
|
by: dbuchanan |
last post by:
Hello,
Here is the error message;
----------------------------
Exception Message:
ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child
key values (5) to exist in the...
|
by: Kiyomi |
last post by:
Hello,
I use in my application MessageBox.Show and it works perfectly when I run
this application on my local computer (http://localhost). When I diployed
this application on the server,...
|
by: Que |
last post by:
Hi
I have a form that catches an exception and throws a Messagebox
Is it possible to throw the message box to center in the form that
throws the exception
Like Centre in parent form or...
|
by: rdemyan via AccessMonster.com |
last post by:
Sometimes users (including myself) accidentally click on the application
close icon in the application menu bar when they meant to just click on the
'X' for the form. Of course the app closes and...
|
by: hgarg |
last post by:
The onpaint() is getting called before calculating the required parameters by listBox1_SelectedIndexChanged function. I tried calling it at the end of this function. But of no use. Due to this issue...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |