W11 Advance GUI
W11 Advance GUI
Visual
Instructor: Saima Jawad
Programming
Advance
GUI Design
Tab Control
ListView
TreeView
Split Container
Progress Bar
Status Bar
Week-11 Outline
Tab pages
Tab Control
6
TabControl
Controls in
TabPage
TabControl Description
properties and
events
Common Properties
ImageList Specifies images to be displayed on a tab.
MultiLine Indicates whether multiple rows of tabs can be displayed.
SelectedIndex Indicates index of TabPage that is currently selected.
Using TabControl
ListView
14
listView.Columns.Add("ProductName", 100,
HorizontalAlignment.Center);
Listview Example
24
conListView.View = View.Details;
conListView.GridLines = true;
conListView.FullRowSelect = true;
conListView.Items.Add(listViewItem);
NTextBox.Text = "";
ETextBox.Text = "";
PTextBox.Text = "";
}
Listview Example
26
TreeView
28
Common Event
FullPath Indicates the path of the node, starting at the root of the tree.
ImageIndex Specifies the index of the image to be shown when the node is deselected.
LastNode Specifies the last node in the Nodes collection (i.e., last child in tree).
Treeview Example
using System.IO;
} // end if
}
// catch exception
catch ( UnauthorizedAccessException )
{
parentNode.Nodes.Add( "Access denied" );
}
} // end PopulateTreeView
Treeview Example
While the user is moving the splitter, the split container fires a
SplitterMoving event.
ProgressBar progress;
progress.Minimum = 0;
progress.Maximum = 255;
progress.Minimum = 0;
progress.Maximum = 200;
progress.Value = 88;
if (progressBar.Value == progressBar.Maximum)
{
myTimer.Stop();
MessageBox.Show("Server has been connected");
this.Close();
}
}
// Create a StatusBar
StatusBar mainStatusBar = new StatusBar();