Exforsys.com
 
Home Tutorials VB.NET 2005
 

.NET Common Windows Forms Controls Part 2

 

.NET Common Windows Forms Controls Part 2 - Page 3

Page 3 of 3


.


.



TrackBar

Trackbars are very much like scroll bars but the difference is in the appearance. Track bars look more like controls you might see on the stereos that control volume. You can configure the track bars range with minimum and maximum properties. You can also specify how much the value property should be incremented when clicks occur to the sides of the slider by means of the LargeChange property. The SmallChange property is the value changes that occur when the slider is manipulated by the user. A track bar can be displayed both horizontally and vertically.


Let us now create a new project in Visual Basic Express.


Drag and drop a TrackBar control, a label and a Command button as shown in the following screenshot:




Now add the following lines of code to the Page:


Click here for Sample Code


The output generated by the program is shown below:



ProgressBar

Progress bars are those simple controls that slow the progress of some operation by displaying rectangles in the horizontal bar. The main properties of a progress bar are value, minimum and maximum. You can use minimum and maximum properties to set the maximum and minimum values the progress bar can display. To change the display, you can write a code to set the value property. If the Maximum property is set to 100, the Minimum property is set to 10, and the value property is set to 60, then 60 rectangles will appear.


  • Create a new Visual Basic Project add a progress bar and two command buttons and two Labels.
  • Then add the following code to the form:

Click here for Sample Code


 


  • The output generated by the above program is given below:


HScrollBar and VScrollBar

A Scroll bar is a tool that allows the user to scroll through the windows. There are two types of scroll bars namely VScroll or HScroll. This usually appears automatically and disappears automatically if the content of the window reduces. You can also attach scrollbars manually by setting the property at design time or add it programmatically using the code. The sample code for attaching the ScrollBars for the TextBox1 is shown below


TextBox1.ScrollBars = ScrollBars.Both
The other possible values are ScrollBars.Vertical, ScrollBars.None and ScrollBars.Hornizontal





First Page: .NET Common Windows Forms Controls Part 2


Read Next: Working with Menu Controls



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2009 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape