reading value with messagebox? (input box)

  • Thread starter Thread starter Cantekin Guneser
  • Start date Start date
C

Cantekin Guneser

in my program when a button clicked , a process starts, but i need to
take two value, becouse of this, i use a new windows form, to make my
program more userfriendly, i was thinking is it possible totake values with
messagebox or some diyalog box (as in delphi inputbox),
when button clicked, it will show messagebox with two text field and two
header (for text boxes).
is there way to do it in C#

thanks in advance
 
Sure this is possible. I would create a new form with the 2 textboxes and a
button to submit the values. Then from startup code of your application, you
could show the from using the ShowDialog method. You'd have to make 2 public
properties on your form, representing the value of the 2 textboxes. The
submit button would hide the form (this.Hide();).

For example, you could use the form like this:

InputBoxForm f = new InputBoxForm();
f.ShowDialog(); //This will show the dialog and wait until the button has
been clicked.
string s = f.Value1;
string t = f.Value2;
 
Back
Top