Lecture 5 VB Net Container Controls Container Controls
Lecture 5 VB. Net Container Controls
Container Controls 1. Flow Layout Panel Control 2. Group Box Control 3. Panel Control 4. Split Container Control 5. Tab Control 6. Table Layout Panel Control
1. Flowlayout Panel The Flow. Layout. Panel dynamically repositions the controls it contains. The Flow. Layout. Panel also supports Scroll when the Auto. Scroll property is set to True. Flow. Direction Property Handles direction of child controls Values: Left. To. Right, Top. Down, Right. To. Left, Bottom. Up Flow. Layout. Panel 1. Flow. Direction = Flow. Direction. Top. Down
1. Flowlayout Panel Auto. Scroll Property: When Auto. Scroll property is set to True then Flow. Layout. Panel supports Scroll. Flow. Layout. Panel will show scroll bar when some control not fit in the specified area of Flow. Layout. Panel 1. Auto. Scroll = True Border Style Property Set border of flow layout Panel Values: Fixed Single, Fixed 3 D, None Flow. Layout. Panel 1. Border. Style = Border. Style. Fixed. Single
2. Group Box Control Captioned Container displays a frame around a group of controls. When you move the Group. Box control, all of its contained will also move.
3. Panel Control The Panel control is displayed by default without any borders at run time. Back color Property: Used to set back color of control Panel 1. Back. Color = Color. Red Transparency Property It will set control area as a transparent. Me. Transparency. Key = Color. Red
4. Split Container Control A Split Container has two panels. These panels can have their own properties and events. The first panel is represented by Panel 1 and second panel is represented by Panel 2. Panel Collapsed ▪ One panel can be collapsed and full area will be covered by one panel. ▪ Split. Container 1. Panel 1 Collapsed = True Background Image ▪ Instead of a single color, an image can be displayed as the background. The image only appears in the splitter bar.
5. Tab Control This control is used to display a lot of necessary information on the screen with limited space. It splits the data on the screen logically into different sections. By default two tabs are added to the control. Tabpages Property: It is used to add more tabs to Tab pages to the control. Tab. Control 1. Tab. Pages. Add("new page title")
5. Tab Control Selected tab method Used to diagnose which tabpage is selected. Write following code in Selected. Index. Changed event of Tab. Control 1. ▪ Msg. Box(Tab. Control 1. Selected. Tab(). Text) Dock Property for Tab control Set the size of control, either custom level (none) or equal to its form (Fill)
5. Tab Control Multiline Property Set the Multi. Lineproperty of the Tab. Control control to true for cascading tabs.
5. Tab Control Alignment Property Decide placement of tabs on Top, Left, Right, and Bottom.
5. Tab Control Appearance Property Converts tabs into buttons Values: Normal (the default), Buttons, and Flat. Buttons. ▪ Note: ▪ The Normal and the Buttons values can be used on all four views. ▪ The Flat. Buttons option is available only if the Alignment property is set to Top.
6. Table Layout Panel Control Table. Layout. Panel control represents a panel that dynamically lays out its contents in a table format.
6. Table Layout Panel Control Collection Property: This property is used to set the column style of control. Cell Border Style Insert: Add above Add: Add Below
6. Table Layout Panel Control Some important Properties dynamic. Table. Layout. Panel. Location = New System. Drawing. Point(26, 12) dynamic. Table. Layout. Panel. Name = "Table. Layout. Panel 1" dynamic. Table. Layout. Panel. Size = New System. Drawing. Size(228, 200) dynamic. Table. Layout. Panel. Back. Color = Color. Light. Blue
Menus & Toolbars 1. Context Menu Strip 2. Menu Strip 3. Startup Strip 4. Tool Strip 5. Tool Strip Container
Context Menu Strip control represents a shortcut menu that pops up over controls, usually when you right click them. They appear in context of some specific controls, so are called context menus. For example, Cut, Copy or Paste.
Context Menu Strip (Steps) Step 1: Include context menu strip in form Step 2: Add cut, copy and paste options in it. Step 3: Add rich. Text. Box control in form. Step 4: Set Context. Menu. Strip property of richtextbox to Context. Menu. Strip 1. Step 5: Double click each option of the Context menu and write respective code: Rich. Text. Box 1. Cut() Rich. Text. Box 1. Copy() Rich. Text. Box 1. Paste()
Menu Strip Control The Menu. Strip control works as the top-level container for the menu structure. The Tool. Strip. Menu. Item class and the Tool. Strip. Drop. Down. Menu class provide the functionalities to create menu items, sub menus and drop-down menus.
Status Strip Control A horizontal bar that displays in the bottom section of a form used to display messages to the user. Status. Strip control is a powerful Status. Bar control. Status. Strip provides Progress. Bar, Dropdown. Button, Split. Button, and Label features.
Status Strip Control Add Tool Strip Progress Bar While Tool. Strip. Progress. Bar 1. Value < 100 Tool. Strip. Progress. Bar 1. Value += 5 End While Add three options in Tool Strip Drop Down Button Status. Strip 1. Back. Color = Color. Red Status. Strip 1. Back. Color = Color. Green Status. Strip 1. Back. Color = Color. Blue
Tool Strip Control Provides functionality of a Windows toolbar controls Item property is used to set the properties of each control added in strip.
Tool. Strip. Container Tool Strip Container control is a container of Tool Strip, Menu Strip or Status Strip. Tool Strip Container allows more than one Tool Strip control in side Tool Strip Container. Panel on each side of the Form can contain only Menu Control (Tool Strip, Menu Strip or Status Strip).
- Slides: 23