Link to home
Start Free TrialLog in
Avatar of Rahamathulla_J
Rahamathulla_J

asked on

messagebox display in taskbar

//Rahamath
                                    this.btnAddRecord.Location = new System.Drawing.Point(416, 304);


this.btnEditAuthenticate.Location = new System.Drawing.Point(252, 304)

I my winform application after the form loads it will populate a message box using thread for user input (Ok/Cancel). It is working fine. The problem is the message box directly loaded in the taskbar so the user has to click that tab from the panel to see the message box in the center screen. The new user may not aware of that the appliation need a user input.

I want to show the message box in the center screen instead in the taskbar how can i do this? and what is the problem.
Avatar of Adecus
Adecus

To display a messagebox on a form so it is modal to that form you must hand in the form object to the messagebox show call:

MessageBox.Show(FormObject, "MyMessage");

In your case, I think you will have the code:

MessageBox.Show(this, "MyMessage");

-Adecus
If this did not solve your problem, post the code that you're using right now to display the message box.
Also, if you want the form to be focussed to the user immediately you can use the code:
this.Activate();
MessageBox.Show(this, "MyMessage");
Avatar of Rahamathulla_J

ASKER

Hi Adecus,

I tried your idea
MessageBox.Show(this, "MyMessage");

the message box coming behind the main form screen. What is the problem? I hope this is the problem with the running of 2 threads. 1 main thread and 1 thread for the Messagebox
ASKER CERTIFIED SOLUTION
Avatar of jinn_hnnl
jinn_hnnl
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial