This document is archived and information here might be outdated. Recommended version. |
Provides access to members that work with a dialog for getting a string.
CoClasses and Classes | Description |
---|---|
GetStringDialog | A dialog used for getting a string. |
The get string dialog is a dialog used for getting user input in the form of a string.
To get access to the IGetStringDialog interface, create a new GetStringDialog object.
The following code shows a GetStringDialog and reports the string value that was entered in the dialog. You would get m_app from the hook in ICommand::OnCreate().
IGetStringDialog pGetStrDlg=new GetStringDialogClass();
bool bOK=pGetStrDlg.DoModal("Please enter a string", "String:", "Hello", m_app.hWnd);
if (bOK)
System.Windows.Forms.MessageBox.Show(pGetStrDlg.Value);
else
System.Windows.Forms.MessageBox.Show("Cancelled");
Dim pGetStrDlg As IGetStringDialog=New GetStringDialogClass()
Dim bOK As Boolean=pGetStrDlg.DoModal("Please enter a string", "String:", "Hello", m_app.hWnd)
If bOK Then
System.Windows.Forms.MessageBox.Show(pGetStrDlg.Value)
Else
System.Windows.Forms.MessageBox.Show("Cancelled")
End If