Windows Develop Bookmark and Share   
 index > Windows Forms General > C# and controlling window behaviour
 

C# and controlling window behaviour

Hi,

I am new to coding in C# but what I wish to do seems relatively simple so I reckon the solution is probably not to difficult.

I have written an application (using Visual Basic Studio) which comes up in a normal window like any application. When a user clicks on a button to change a particular attribute another small popup window is displayed to the user allowing them to change what it is they wish to change.

My question is how do you control the popup window such that they are unable to click back onto the parent window until they have submitted their changes or pressed "Ok" on the popup window - I believe focus should be given to the popup window and the titlebar should blink indicating to the user to confirm their choice?

Any help or pointers would be much appreciated.


Thanks.
Jonny1985  Thursday, April 24, 2008 3:04 PM
Use ShowDialog instead of Show when showing the confirmation form.

David M Morton  Thursday, April 24, 2008 3:09 PM
Use ShowDialog instead of Show when showing the confirmation form.

David M Morton  Thursday, April 24, 2008 3:09 PM

heya Smile

as soon as i saw you're post i was wondering if i could do it...

i managed to get this...

private void Click(object sender, EventArgs e)

{

Form2 form = new Form2();

form.Show();

while(form.Created)

{

this.Enabled = false;

Application.DoEvents();

}

this.Enabled = true;

}

this worked for me,

cheers, kiyac

Kiyac  Thursday, April 24, 2008 3:29 PM

Glad you figured out a solution.

Nonetheless, you should go with the .ShowDialog command that David gave you -- much cleaner and more performant.

JayStation3  Friday, April 25, 2008 6:51 PM

You can use google to search for other answers

Custom Search

More Threads

• Masked Textbox control
• namespace nightmares
• Dynamically sized controls, TableLayoutPanel and autoscrolling
• User Experience Challenges
• event handling in modal form
• list box tooltip?
• UserControl doesn't update
• Custom message box mouse capture problem related to UltraCombo
• Drawing controls past form boundries
• Set my application to be on top!?