Windows Develop Bookmark and Share   
 index > Windows Forms General > execute function without Button click
 

execute function without Button click

Hello, here is my dilemma, I have created a function to create a popup window, however it does not popup immediately per say on a button click. when the user fills out the form and clicks the save button it validates there data, if they have any errors then I want to launch this window, so it is not always guaranteed on the button click. How can I either cause a button to be clicked that the user does not click, or force this popup function to execute?

confusedNewbie  Thursday, June 07, 2007 8:58 PM

Nevermind I have figured it out thanks!

confusedNewbie  Thursday, June 07, 2007 9:26 PM
I'm a bit confused about the description of your problem. Maybe if you could post more details it could help. Here's how I understand it.

You have a function, void CreatePopupWindow() that creates a popup window.
You also have a function like, bool DisplayDataIsValid()

Couldn't you, in the event handler for your button put the following code.


private void EventHanlder button_Click(...)
{
if(DisplayDataIsValid())
{
...Do normal stuff...
}
else
{
CreatePopupWindow()
}
}
Pace1  Thursday, June 07, 2007 9:14 PM

Nevermind I have figured it out thanks!

confusedNewbie  Thursday, June 07, 2007 9:26 PM

You can use google to search for other answers

Custom Search

More Threads

• Setting combobox's dropdownstyle does not allow combobox to lose focus when tabbing out
• files needed
• Keypresses in picture box
• DataGridView -- Hiding The Leftmost Column
• Calling a Menu Option thru code
• XmlDocument Error
• SQL help
• how to make a rollover button
• Control in Toolbox - Debug or Release?
• 'tooltip like' pop up box