I have a windows forms application and I need to get an input from user. I decided to use another form. The code in my main windows form like that :
inputPage p = new inputPage();
p.Visible = true;
VBand = p.getValueDouble();
My second form ( where I get the input from the user ) is simple. It contains only a label, textbox and ok button.
My problem is, I want to call getValueDouble function (3rd line of the code above) after when we are sure that user enter the value and press the ok button. So how can I do this?
Thanks..
You probably want to use the Form’s
ShowDialog()method. This will cause your current function to wait until the user clicks the button to close the form.The OK button on the form should have its
DialogResultproperty set toDialogResult.OK.