Assignment File
Assignment File
Proprties :Control
Properties
Textbox 1
Seeting
name
Caption
name
Caption
name
Caption
name
Textbox 2
Label1
Command button
txtfirst
-------txtsecond
-------lblresult
--------cmdsum
caption
&sum
Proprties :-
Control
Properties
Seeting
Textbox1
name
Caption
name
Caption
name
Caption
txtusername
--------txtpassword
--------cmdlogin
Login
Textbox2
Command Button
Option Explicit
Dim strMyusername As String, strMyPassword As String
Private Sub cmdLogin_Click()
'Variable declaration
Dim strUserName As String, strPassword As String
Dim intResponse As Integer
Static intAttempt As Integer
'Check if user attempted 3 times then exit the application
If intAttempt = 2 Then
MsgBox "You have made 3 wrong attempt" _
2
Assignment 4 :Write a program to calculate areaf of circle , the value is input by using inputbox.
Proprties :-
Control
Properties
Command Button
name
Caption
name
Caption
name
Caption
Command Button
Label
Seeting
command1
Area
command2
&Input Value
lblresult
----------
Proprties :-
Control
Properties
Seeting
Command Button
name
cmdeven
Assignment 6:Input any number and print the table of that number.
Proprties :-
Control
Properties
Seeting
Label
name
Caption
name
Caption
name
Text
name
name
Caption
label1
&Enter The Number
label2
&Table
txtnumber
---------lsttable
cmdtable
&table
Label
Text Box
List Box
Command Button
Assignment 7 :Input Day if week in number and show through message box its corresponding day of
week in words.
Proprties :-
Control
Properties
Seeting
Label
name
Caption
name
Text
name
Caption
label1
No Of Week
txtnumber
---------cmdday
&Corresponding Day
Text Box
Command Button
10
Assignment 8:Design a list box and add the items entered in the text box.
Proprties :-
Control
Properties
Seeting
Label
name
Caption
name
Text
name
Caption
name
label1
&Item
txtnumber
------cmdadd
&ADD
lstlist
Text Box
Command Button
List box
11
Assignment 9 :Design a two list box and to copy all the selected items from a multi select list box to
another list box.
Proprties :-
Control
Properties
Seeting
Label
List Box
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
name
label1
add Item
cmdadd1
&ADD
cmdadd2
&ADD
cmdcopy
© to Left
command1
c&opy to Right
list1
List Box
name
list2
Command Button
Command Button
Command Button
Command Button
12
13
Proprties :-
Control
Properties
Seeting
Text Box
Label
name
name
Caption
name
Caption
txtinput
lblinput
Enter A String
cmdok
&OK
Command Button
14
15
Assignment 11 :Write a program to calculate simple interest by using three labels and text box and
one command button.
Proprties :-
Control
Properties
Label
name
Caption
name
Caption
name
Caption
Label
Label
Label
Seeting
label1
&Principal Amount
label2
&interest Rate
label3
&Time Of Interest In
Year
label4
Simple Interest
lblresult
--------txtamont
---------txtrate
---------txttime
--------cmdinterest
&Simple Interest
name
Caption
name
Caption
Label
Textbox
name
Textbox
name
Textbox
name
Text
Text
Command Button
Text
name
Caption
16
Coding:-
17
Proprties :-
Control
Properties
Seeting
List Box
name
List
Label
name
Caption
name
Caption
list1
Factorial
Power
Even Number
Sum Of Digit
label2
result
lblresult
-----------
Label
18
Sub sum()
Dim x As Integer, y As Integer, a As Integer
x = InputBox("Enter The First Value ", "Value")
y = InputBox("Enter The Second Value ", "Value")
a=x+y
lblresult.Caption = a
End Sub
20
Assignment 13:Write a procedure that will take a number as an argument and that will return number
is even or odd.
Proprties :-
Control
Properties
Seeting
Label
name
Caption
name
Caption
label1
Procedure
command 1
Take A Value
Command Button
21
Assignment 14 :Write a program to change image by using image box using timer.
Proprties :-
Control
Properties
Seeting
Image Box
Image Box
Image Box
Image Box
Command Button
name
name
name
name
name
Caption
imageScr1
imageScr 2
imageScr3
imageScr 4
cmdstartstop
&Start Rtation
22
imgScr1.Picture = LoadPicture(strPath2)
imgScr2.Picture = LoadPicture(strPath3)
imgScr3.Picture = LoadPicture(strPath4)
imgScr4.Picture = LoadPicture(strPath1)
bytCounter = 3
Case 3
imgScr1.Picture = LoadPicture(strPath1)
imgScr2.Picture = LoadPicture(strPath2)
imgScr3.Picture = LoadPicture(strPath3) imgScr4.Picture = LoadPicture(strPath4)
bytCounter = 0
End Select
End Sub
24
Assignment 15 :Design four checkbox any color i.e. selected by clicking on checkbox is add to list
box control.
Proprties :-
Control
Properties
Seeting
Check Box
name
Caption
name
Caption
name
Caption
name
Caption
name
chkred(0)
Red
chkred(1)
Green
chkred(2
Blue
chkred(3)
Yellow
list1
Check Box
Check Box
Check Box
List Box
List1.AddItem chkRed(Index).Caption
Else
Dim a As Integer
For a = 0 To List1.ListCount - 1
If List1.List(a) = chkRed(Index).Caption Then
List1.RemoveItem a
Exit For
End If
End If
End Sub
26
Assigment 16 :Draw a form to enter phone number with city code, extract city and phone number in
two different textbox controls.
Proprties :-
Control
Properties
Seeting
Label
name
Caption
name
Caption
name
Caption
name
Text
name
Caption
name
Text
name
Caption
label1
Phone Number
label2
STD code
label3
Phone Number
text1
-------txtpin
-------txtphone
---------command1
&Show
Label
Label
Text Box
Text Box
Text Box
Command Button
27
28
Assigment 17 :Designe a checkbox any item like PEN 2/-, PENCILE 2/- i.e. selected in clicking on
checkbox and calculate their amount after input their quantity in textbox
.
Proprties :-
Control
Properties
Seeting
Label
name
Caption
name
Text
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
label1
Quantity
txtquantity
---------chkpencil
Pencil
chkpen
Pen
chkcutter
cutter
chkrubber
rubber
cmdamount
Amount
lblresult
----------
Text box
Check Box
Check Box
Check Box
Check Box
Command Button
Label
29
30
Assignment 18:Design a form with menu item color in sub menu red,Green , Blue on click form back
color should be change.
Proprties :-
Control
Properties
Seeting
31
Assignment :- 19
Designe a form to enter two number by using interface (input box control) display the
number on form.
32
Proprties :-
Control
Properties
Seeting
Command Button
name
Caption
name
Caption
command 1
Show on Form
command 1
Input Number
Command Button
33
Assignment 20 :In question , store student detail in a database (MS-Access) using data control
operation be ADD,EDIT,DELETE, and SAVE.
Proprties :-
Control
Properties
Seeting
Label
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
name
lblname
Name
lblroll
Roll Number
lblclass
Class
lblage
Age
lbladdress
Address
txtname
Label
Label
Label
Label
Text Box
34
Text Box
Text Box
Text Box
Text Box
Command Button
Command Button
Command Button
Command Button
Command Button
Command Button
Command Button
Command Button
Command Button
Text
name
Text
name
Text
name
Text
name
Text
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
------txtroll
------txtClass
-------txtage
------txtaddress
------cmdfirst
<<
cmdprevious
<
cmdnext
>
cmdLast
>>
cmdadd
&ADD
cmdrem
&Remove
cmdmodify
&Modify
cmdsearch
&Search
cmdupdate
&Update
35
Proprties :-
Control
Properties
Seeting
Command Button
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
name
Caption
name
cmdclear
Clear
Plus
+
div
/
minus
times
*
equals
=
lblscreen
Caption
---------
Command Button
Command Button
Command Button
Command Button
Command Button
Label
38
display.Caption = ""
End Sub
Private Sub plus_Click()
operand1 = Val(display.Caption)
operator = "+"
display.Caption = ""
End Sub
Private Sub times_Click()
operand1 = Val(display.Caption)
operator = "*"
display.Caption = ""
End Sub
40