Title: Layout Controls
1Layout Controls Dialogs
- Business 92
- Fall 2007
- Roldan
2Reminders
- MIS Experience
- Midterm next week bring blue book
- Midterm Review
3Layout Controls
- Use layout controls to organize other controls on
a form - The TabControl allows you to organize sets of
controls in different tabbed pages on the same
form - Use the TabPages property of the TabControl to
change the text property for each Tab
4Dialog Boxes
- Dialog Boxes can be used to obtain user input
for common tasks like saving formatting changes
Code Anatomy If SaveFileDialog1.ShowDialog()
Windows.Forms.DialogResult.OK Then
MsgBox(SaveFileDialog1.FileName) End If
5Message Boxes
- Message Boxes can be used to obtain simple
answers from users - See page 223 for values equivalent to button
clicks in a message box
Code Anatomy Dim I As Integer I
MsgBox("Do you want to develop weapons of mass
destruction?", MsgBoxStyle.YesNoCancel,
"PC-Apocalypse") MsgBox("This is the
button you clicked " CStr(I))
6Code Anatomy If..ThenElseif
- Dim response As MsgBoxResult
- response MsgBox("do you really want to
exit", MsgBoxStyle.YesNo) - If response MsgBoxResult.Yes Then
- End
- ElseIf response MsgBoxResult.No Then
- Me.Show()
- End If
7Code Anatomy ForNext
TextBox1.Clear() Dim i As Integer
For i 1 To ListBox1.SelectedItems.Count
TextBox1.Text TextBox1.Text
ListBox1.SelectedItems.Item(i - 1) vbCr vbLf
Next
8Input Boxes
- An input box allows users to enter free form
answers in response to prompts
Code Anatomy Dim Answer As String
Answer InputBox("type something", "testing")
MsgBox(Answer)