Posted By

jimfred on 11/20/09


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

khouser


Input Box, similar to MessageBox, displays a prompt and accepts a string from the user.


 / Published in: C#
 

URL: http://www.knowdotnet.com/articles/inputbox.html

The URL has code for an InputBoxDialog class that implements a simple input dialog.

The button flatstyle property might need to be changed to match the default.

  1. // Example usage. See URL for implementation.
  2.  
  3. InputBoxDialog ib = new InputBoxDialog();
  4.  
  5. ib.FormPrompt = prompt;
  6. ib.FormCaption = title;
  7. ib.DefaultValue = defaultValue;
  8.  
  9. ib.ShowDialog();
  10.  
  11. string s = ib.InputResponse;
  12.  
  13. ib.Close();

Report this snippet  

You need to login to post a comment.