Example #1
0
 /// <summary>
 /// Displays the input box as a modal dialog box with the specified owner.
 /// </summary>
 /// <param name="owner">The <see cref="System.Windows.Forms.IWin32Window"/> that will be the owner of the dialog box.</param>
 /// <returns>The <see cref="DialogResult"/></returns>
 public DialogResult ShowDialog(System.Windows.Forms.IWin32Window owner)
 {
     using (InputDialogForm frm = new InputDialogForm())
     {
         frm.MainInstruction    = MainInstruction;
         frm.Content            = Content;
         frm.Text               = WindowTitle;
         frm.Input              = Input;
         frm.UsePasswordMasking = UsePasswordMasking;
         frm.MaxLength          = MaxLength;
         frm.OkButtonClicked   += new EventHandler <OkButtonClickedEventArgs>(InputBoxForm_OkButtonClicked);
         DialogResult result = frm.ShowDialog(owner);
         if (result == DialogResult.OK)
         {
             Input = frm.Input;
         }
         return(result);
     }
 }
Example #2
0
 /// <summary>
 /// Displays the input box as a modal dialog box with the specified owner.
 /// </summary>
 /// <param name="owner">The <see cref="System.Windows.Forms.IWin32Window"/> that will be the owner of the dialog box.</param>
 /// <returns>The <see cref="DialogResult"/></returns>
 public DialogResult ShowDialog(System.Windows.Forms.IWin32Window owner)
 {
     using( InputDialogForm frm = new InputDialogForm() )
     {
         frm.MainInstruction = MainInstruction;
         frm.Content = Content;
         frm.Text = WindowTitle;
         frm.Input = Input;
         frm.UsePasswordMasking = UsePasswordMasking;
         frm.MaxLength = MaxLength;
         frm.OkButtonClicked += new EventHandler<OkButtonClickedEventArgs>(InputBoxForm_OkButtonClicked);
         DialogResult result = frm.ShowDialog(owner);
         if( result == DialogResult.OK )
             Input = frm.Input;
         return result;
     }
 }