W08 Dialogs
W08 Dialogs
Visual
Instructor: Saima Jawad
Programming
Dialogs
MODAL AND MODELESS DIALOGS
COMMON DIALOGS
DIALOG CONFIGURATION
CUSTOMIZED DIALOGS
Week-08 Outline
Dialog Box
4
ColorDialog
FileDialog
FontDialog
PageSetupDialog
PrintDialog
using System.Windows.Forms.CommonDialog;
File Dialog
12
OpenFileDialog Example
18
FormBorderStyle: FixedDialog
StartPosition: CenterParent
MinimizeBox: False
MaximizeBox: False
ShowInTaskbar: False
Accepting an Action
22
Add OK Button
28
Property Value
Name okButton
Text OK
mainForm mForm;
if (textBox.Text != string.Empty)
{
mForm.listBox.Items.Clear();
string[] stringsEntered = textBox.Lines;
for (int count = 0; count < stringsEntered.Length; count++)
mForm.listBox.Items.Add(stringsEntered[count]);
}
this.Close();