Big InputBox

  • Thread starter Thread starter Graham
  • Start date Start date
G

Graham

I need to emulate an input box that is about 3 lines
taller then the normal. My prompt is running under the
text box! So I made my own InputBox windows form.

I want to call my form just like you would an inputbox.
The problem I am facing is returning the user input after
they click the OK button.

Any examples would be greatly appreciated.

TIA,
Graham
 
Declare a Property for each piece of information you want to have returned.

Then, after calling showdialog, check if DialogResult.OK and if so, then get
each of the forms properties. On the form, behind the OK button's click
event, set the properties. When the Dialog is returned after that, the
calling form will have acccess to each of the properties


frmDialog f = new frmDialog();
switch(f.ShowDialog()){
case: DialogResult.Ok
myVariable1 = f.FirstProperty;
break;
myVariable2 = f.SecondProperty;
break;

}

then, behind the ok button of the Dialog form


this.FirstProperty = textBox1.text;
this.SecondProperty = textBox2.text;

HTH,

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top