IMAGE LISTS, TREE LISTS,TOOL BARS, STATUS AND PROGRESS BARS,TAB ,LIST VIEW
IMAGE LISTS
end if
end sub
TREE VIEWS
TOOLBARSBUTTON PROPERTIES
msgbox("you clicked pink")
end sub
private submenuitem2_click(byval sender as system.object, byval e as system.eventargs) handles menuitem2.click
msgbox("you clicked red")
end sub
Private sub menuitem3_click(byval sender as system.object, byval e as system.eventargs) handles menuitem3.click
msgbox("you clicked pink")
end sub
STATUS BARS
CREATING SIMPLE STATUS BAR
Private sub form1 _mouseleave(byval sender as objects, byval e as system.eventargs)
CREATING THE PROGRESS BARS
private sub timer1_tickk(byval sender as system .objects,byval e as system.eventargs)
timer1.enabled=false
end if
end sub
IMAGE LISTS
The image lists can be used to store images;they form a kind of images repository.This does not sound terribly useful,but in facts , there are plenty of controls ,that are designed to work with image lists list view ,tree views,toolbars ,tab controls, checkboxes _ ,button,radio button,and labels, all of that ahve an image lists and imageindex property. When you associate an image list with a controls image list property ,you can specify that image appear in the controls with the imageindex property .The images in an image list are indexed ,starting at 0 ,and you can switch the image displayed in a control at runtime by changing the value of the imageindex property.CREATING IMAGE LISTS
When you click the image lists's image property in the properties windows ,a collection editor opens , you can add new image to the image lists by clicking the add button or remove them by clicking the remove button.
you can set the size of the images in the image list ( default 16*16 pixels, the size of a small icon) with its imagesize property in the properties windows.You can also add image to image lists in code .ADDING IMAGES TO IMAGE LISTS IN CODE
You have already seen that you can add new images lists at design time by using a collection editor with the images collection in the image list, but you can also add new size images to an image list in code:private sub button4 _click(BYVal sender as system .objects,byval e as system.eventsargs)
if openfiledialog1.showdialog()= dialogresult.ok then
if not (openfiledialog1.filenames is nothing ) then
Dim intloopindex as integer
for intloopindex = 0 To openfiledialog1.filenames.length-1
imagelist1.images.add(image.fromfile(openfiledialog1.filenames(intloopindex)))
next intloopindexelse
imagelist1.images.add(image.fromfile(openfiledialog1.filenames(openfiledialog1.filename)))end if
end if
end sub
TREE VIEWS
Tree view can be used to display a hierarchy of nodes .Each node is not only displayed visually,but you can also have child nodes. , that uses a tree view in its left paneto display the hierarchy of folders on disk. You can expand and collapse parents nodes by clicking them; when expanded , their children are also visible .TREE VIEW PROPERTIES
- BORDERSTYLE= Gets thr tree view's border style.
- CHECKBOXES= Gets whether checboxes should be displayed next to tree nodes.
- FULLROWSELECT=Gets whether a selection should select the whole width of the tree view .
- HIDESELECTION=Sets whether the selected tree node stays highlighted when the tree view loses the focus.
- IMAGE INDEX=Sets the image list index of the current image.
- IMAGELIST = Sets the image list used with the tree view.
- ITEMHEIGHT=Sets the height of tree nodes.
- AFTERCHECK= Occurs when a node checkbox is checked.
- AFTERCOLLAPSE= Occurs when a tree nodes is collapsed.
The toolbars controls allows you to create toolbars by adding TOOLBARBUTTON objects to the toolbar's button collection.At design time ,an editor appears to add button to a toolbar ; each button can have text and /or an image .At runtime ,you can add or remove button from the toolbar using the add and remove methods of the button property .To create a collection of TOOLBARBUTTON controls to display in a toolbars ,you add the button individually at design time ,or at run time using the add method of the button property, or using the addrange method to add a number of button at once.
TOOLBARSBUTTON PROPERTIES
- ENABLED= Gets if the button ie enabled.
- IMAGEINDEX= Gets the index value of the image for a button.
- PARENT= Gets the toolbars that the button is a child.
- STYLE= Sets the style of a buton
- TEXT= Sets the text displayed in the button.
- VISIBLE= Gets if the toolbars button is visible.
CREATING TOOLBAR DROPDOWN BUTTON
Drop-down button are one of the most useful styles of toolbars ; these buttons can display a drop-down menu if you click their down arrow .To add a menu to a drop-down button ,you can create a menu ,such as a context menu, and assign that menu to the drop-down button dropdownmenu property.To see how this works , take a look at the toolbars.Private sub menuitem1_click(byval sender as system.object, byval e as system.eventargs) handles menuitem1.click
msgbox("you clicked pink")
end sub
private submenuitem2_click(byval sender as system.object, byval e as system.eventargs) handles menuitem2.click
msgbox("you clicked red")
end sub
Private sub menuitem3_click(byval sender as system.object, byval e as system.eventargs) handles menuitem3.click
msgbox("you clicked pink")
end sub
STATUS BARS
Although toolbars usually appear right under menu bars ;status bars usually appear at the bottom of a window and give the user some additional information ,such as the page number they are editing ,or whether or not the program is connected to the internet,a and so on. In vb.net ,you support ststus bars with the status bars control.
To make the status bar into a simple status bar, that means you can display a single message on the ststus bars ,set the showpanel property to false (this is the default) and set the text property of the status bar to the text you want to display .Typically ,however , status bars are divided into panels by adding statusbarpanel objects to the status bars and setting the showpanel property to true .You can keep track of panel in a status bars using the panels collection ,setting the text in a panel this way EXAMPLE:
STATUSBARS1.PANELS(0).TEXT="ALL IS OK".You can add panels to a status bar at design time by clicking the panel properties in the properties windows and using the collection aditoe that appear , or by the add method of the panels collection in code.
CREATING SIMPLE STATUS BAR
Private sub form1 _mouseenter(byval sender as objects, byval e as system.eventargs)
status bar1.text="mouse entered"end sub
Private sub form1 _mouseleave(byval sender as objects, byval e as system.eventargs)
status bar1.text="mouse right"end sub
PROGRESS BARS
Progress bars are those simple controls that show the progress of some operation by displaying rectangles in a horizontal bar , that is the progressbars , the progress bars is being drawn using timer events that start when you click the start button . when the operation finishes , the progress bar is filled; the idea here is to give the user some visual feedback on how the operation is progressing ,and how long it will take.PROGRESS BAR PROPERTIES
- FONT=Sets the font of the progress bar's text.
- FORE COLOR= Sets the foreground color of the progress bar.
- MAXIMUM= Sets the progress bar max value.
- MINIMUM= Sets the progress bar minimum value.
- STEP=Sets the value by which the performstep method will increase a progress bar value.
- VALUE=Sets the current value of the progress bar.
CREATING THE PROGRESS BARS
The primary properties of progress bars like scroll bars ,are min,max, and value.private sub button1_click(byval sender as system .objects,byval e as system.eventargs)
Timer1.enabled = trueend sub
private sub timer1_tickk(byval sender as system .objects,byval e as system.eventargs)
progressbar1,value+=1If progressbar1.value=progressbar1.maximum then
timer1.enabled=false
end if
end sub
nyce one
ReplyDelete