System.Windows.Forms.Form.ShowDialog C# (CSharp) Method

ShowDialog() public method

public ShowDialog ( ) : DialogResult
return DialogResult
		public DialogResult ShowDialog() {
			return ShowDialog (null);
		}

Same methods

Form::ShowDialog ( IWin32Window owner ) : DialogResult

Usage Example

Example #1
0
        /// <summary>Displays Any String</summary>
        /// <param name="StringToDisplay">Object with Properties to edit</param>
        /// <param name="pDaddy">Parent Form Or Nothing (null)</param>
        /// <param name="strTitle">Window Title</param>
        public static void DisplayABigString(string StringToDisplay, System.Windows.Forms.Control pDaddy, string strTitle = "")
        {
            System.Windows.Forms.Form frmEO = new System.Windows.Forms.Form();
            TextBox T = new TextBox()
            {
                Multiline = true, ScrollBars = ScrollBars.Both, Dock = DockStyle.Fill, WordWrap = false
            };

            frmEO.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
            frmEO.Text            = strTitle;
            frmEO.Controls.Add(T);
            T.Text            = StringToDisplay;
            T.Font            = CourierNew();
            T.SelectionStart  = 0;
            T.SelectionLength = 0;
            T.KeyDown        += TextBox_KeyDown;
            frmEO.Hide();
            frmEO.Height = 640;
            frmEO.Width  = 640;
            System.Windows.Forms.Application.DoEvents();
            if (pDaddy == null)
            {
                frmEO.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                frmEO.ShowDialog();
            }
            else
            {
                frmEO.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                frmEO.ShowDialog(pDaddy);
            }
            frmEO.Dispose();
        }
All Usage Examples Of System.Windows.Forms.Form::ShowDialog
Form