controls
1)button.
private sub button1_click(byval sender as [Link], byval e as
[Link]) handles [Link]
dim cek as new checkbox
[Link] = new size(100, 20)
[Link] = [Link]
[Link] = "checkbox1"
[Link] = true
[Link](cek)
end sub
private sub button2_click(byval sender as [Link], byval e as
[Link]) handles [Link]
dim pnl as new panel
dim txt as new textbox
dim label as new label
[Link] = new point(60, 20)
[Link] = new size(500, 500)
dim cek1 as new checkbox
[Link] = new size(100, 20)
[Link] = "sss"
[Link](pnl)
[Link](cek1)
'[Link](cek2)
'[Link](cek3)
end sub
2)‘runtime txt,rich txt, lbl,linklbl
#region "runtime text box"
private sub btntxt_click(byval sender as [Link], byval e as
[Link]) handles [Link]
dim txt as new textbox
[Link] = new size(100, 200)
[Link] = "hai elango"
[Link](txt)
end sub
#end region
#region "runtime rich text box"
private sub btnrichbox_click(byval sender as [Link], byval e
as [Link]) handles [Link]
dim richtxtbox as new richtextbox
[Link] = new size(100, 100)
[Link] = new point(20, 40)
[Link] = "welcome"
[Link](richtxtbox)
end sub
#end region
#region "runtime label box"
private sub btnlbl_click(byval sender as [Link], byval e as
[Link]) handles [Link]
dim lblbox as new label
[Link] = new size(200, 50)
[Link] = new point(20, 150)
[Link] = "new label box"
[Link](lblbox)
end sub
#end region
#region "runtime linklabel box"
private sub btnlnk_click(byval sender as [Link], byval e as
[Link]) handles [Link]
dim lnklblbox as new linklabel
[Link] = new size(200, 50)
[Link] = new point(20, 200)
[Link] = "new label box"
[Link](lnklblbox)
end sub
#end region
private sub linklabel1_linkclicked(byval sender as [Link],
byval e as [Link]) handles
[Link]
[Link]("[Link]")
end sub
3) 'in this checked listbox,listbox,comboboxes,picture boxes are
explianed
#region "listbox"
private sub btnlistbox_click(byval sender as [Link], byval e
as [Link]) handles [Link]
'adding the items in listbox by using forloop
dim item as integer
for item = 1 to 10
[Link]("name" & [Link]())
next
end sub
private sub lstbox1_selectedindexchanged(byval sender as
[Link], byval e as [Link]) handles
[Link]
[Link] = [Link] ''''it retrive the
numerical value i.e position
'[Link] = [Link] ''''it retrive the
selected iitem
'[Link] = [Link]
end sub
#end region
#region "checkedlistbox"
dim state as checkstate
private sub txtchklstbox_click(byval sender as [Link], byval
e as [Link]) handles [Link]
[Link] = true
end sub
private sub checkedlistbox1_itemcheck(byval sender as object, byval
e as [Link]) handles
[Link]
state = [Link](0)
' dim newvalue as integer
select case [Link]
'to select the checked value in the checkbox
case [Link]
[Link] = "item" & [Link] + 1 & "is
checked "
'to select the unchecked value in the checkbox
case [Link]
[Link] = "item" & [Link] + 1 & " is
unchecked"
end select
end sub
#end region
private sub commonfunction2_load(byval sender as [Link],
byval e as [Link]) handles [Link]
[Link]("www")
end sub
end class
4) progressbar
private sub button1_click(byval sender as [Link], byval e as
[Link]) handles [Link]
[Link] = true '''' after clicking the button1, the
timer will be start(i.e timer region) and end when progress bar get its
max value. after that timer will be disabled
end sub
#region "timer"
private sub timer1_tick(byval sender as [Link], byval e as
[Link]) handles [Link]
[Link] += 1
if [Link] = [Link] then
[Link] = false
end if
end sub
#end region
end class
5)trackbar
private sub trackbar1_scroll(byval sender as [Link], byval e as
[Link]) handles [Link]
[Link] = "the track bar value is:" & [Link]
end sub
end class
6)date and time picker
private sub datetimepicker1_valuechanged(byval sender as [Link],
byval e as [Link]) handles [Link]
[Link] = [Link]
'[Link] = "mmmm dd yyyy hh:mm:ss tt"
'[Link] = "mmmm dd hh:mm:ss tt"
'[Link] = "mmmm dd yyyy tt"
[Link] = "mm dd yy mm" ''''mm-denotes
the month
''''mm-denotes the minitus
end sub
private sub monthcalendar1_datechanged(byval sender as
[Link], byval e as [Link])
handles [Link]
'[Link] = "day of the month selected: " &
[Link] '''' selectionrange contains
'start' and end' day
'[Link] = "day of the year selected: " &
[Link] ''''selectionstart contains
'day','month','year'
'[Link] = "day of the month selected: " &
[Link]
[Link] = "day of the week selected: " &
[Link]
end sub
end class
7)timer
dim balarm as boolean
private sub timer1_tick(byval sender as [Link], byval e as
[Link]) handles [Link]
[Link] = timeofday
if [Link] <> "" and [Link] <> "" and [Link] <>
"" then
dim alarm = new datetime([Link], [Link],
[Link], val([Link]), val([Link]), val([Link]))
if now >= alarm and balarm then
beep()
[Link] = "alarm on"
end if
end if
end sub
private sub button1_click(byval sender as [Link], byval e as
[Link]) handles [Link]
[Link] = true
end sub
private sub rdotimer1_checkedchanged(byval sender as [Link],
byval e as [Link]) handles [Link]
if [Link] = true then
balarm = true
end if
end sub
private sub rdotimer2_checkedchanged(byval sender as [Link],
byval e as [Link]) handles [Link]
if [Link] = true then
balarm = false
end if
end sub
end class
8)tooltip & erroer provider
private sub tooltipanderrorprovider_load(byval sender as [Link],
byval e as [Link]) handles [Link]
[Link](textbox1, "enetr the name")
[Link](textbox2, "enetr the password")
end sub
private sub button1_click(byval sender as [Link], byval e as
[Link]) handles [Link]
if [Link] = "" then
[Link](textbox1, "must enter name")
end if
if [Link] = "" then
[Link](textbox2, "must enter pasword")
end if
end sub
end class
9)tab page control
private sub panel1_paint(byval sender as [Link], byval e as
[Link]) handles [Link]
[Link](textbox1, "enter your name")
[Link](textbox2, "enter your password")
end sub
private sub button1_click(byval sender as [Link], byval e as
[Link]) handles [Link]
if [Link] = "" then
[Link](textbox1, "you should enter your
name")
end if
if [Link] = "" then
[Link](textbox2, "you should enter your
password")
end if
end sub
private sub button3_click(byval sender as [Link], byval e as
[Link]) handles [Link]
close()
end sub
private sub button4_click(byval sender as [Link], byval e as
[Link]) handles [Link]
close()
end sub
end class
10)treeview and list view
private sub button1_click(byval sender as [Link], byval e as
[Link]) handles [Link]
static index as integer = 0
if index < [Link] - 1 then
index += 1
else
index = 0
end if
[Link] = [Link](index)
end sub
private sub treeview1_afterselect(byval sender as [Link],
byval e as [Link]) handles
[Link]
if [Link] = true then
[Link] = "you unchecked:" & [Link]
else
[Link] = "you checked:" & [Link]
end if
end sub
private sub btn_click_click(byval sender as [Link], byval e
as [Link]) handles btn_click.click
'[Link] = true
end sub
private sub image_click(byval sender as [Link], byval e as
[Link]) handles [Link]
[Link] = true
end sub
private sub treeview_click(byval sender as [Link], byval e as
[Link]) handles [Link]
[Link] = true
end sub
end class
11)color dialogebox
private sub btn_color_click(byval sender as [Link], byval e as
[Link]) handles btn_color.click
'toolbox-color dialogclass
'if [Link] <> [Link] then
' lbl_color.text = " this is new color"
' lbl_color.forecolor = [Link]
'end if
'manual-color dialogclass
dim color as new colordialog
if ([Link] <> [Link]) then
lbl_color.text = "this is new color"
lbl_color.forecolor = [Link]
end if
end sub
end class
12)font dialogbox
private sub btn_display_click(byval sender as [Link], byval e as
[Link]) handles btn_display.click
'toolbox-font dialogbox
if [Link] <> [Link] then
rich_font.font = [Link]
rich_font.forecolor = [Link]
end if
'font dialog through coding
'dim font as new fontdialog
'if ([Link] <> [Link]) then
' rich_font.font = [Link]
' rich_font.forecolor = [Link]
'end if
end sub
end class
13)open file dialog box
private sub button1_click(byval sender as [Link], byval e as
[Link]) handles btn_fileopen.click
'dim openfiledialog1 as new openfiledialog
'[Link]()
'if ([Link]) <> [Link] then
' [Link] =
[Link]([Link])
'end if
if ([Link] <> [Link]) then
[Link] = [Link]([Link])
end if
end sub
private sub btn_filesave_click(byval sender as [Link], byval
e as [Link]) handles btn_filesave.click
dim savefiledialog1 as new savefiledialog
[Link]()
if ([Link] <> [Link]) then
msgbox("you chose" & [Link])
end if
end sub
private sub openfiledialog3_fileok(byval sender as [Link],
byval e as [Link]) handles
[Link]
[Link] = true
end sub
end class
14)print dialog box
private sub printdialogclass_load(byval sender as [Link], byval
e as [Link]) handles [Link]
[Link] = "on a new form drag a printdialog,
printdocument,printpreviewcontrol, printpreviewdialog, pagesetupdialog,
mainmenu and a richttextbox contol. select mainmenu and in the part,
type file and under file type print, printpreview, pagesetup and
ppcontrol. the menu should look like this:file->print, printpreview,
pagesetup, ppcontrol. the richtextbox control is used to load some text
in it which will be ready to print. the form in design view should look
like the image below"
end sub
private sub menuitem2_click(byval sender as [Link], byval e
as [Link]) handles [Link]
if [Link] <> [Link] then
[Link] =
[Link]
[Link]()
end if
end sub
private sub menuitem3_click(byval sender as [Link], byval e
as [Link]) handles [Link]
if [Link] <> [Link] then
msgbox("pagesetup is correct")
else
msgbox("pagesetup is not correct")
end if
end sub
private sub menuitem4_click(byval sender as [Link], byval e
as [Link]) handles [Link]
with pagesetupdialog1
.pagesettings = [Link]
end with
if [Link] = [Link] then
[Link] =
[Link]
end if
end sub
end class