Khushi VB
Khushi VB
Khushi VB
INPUT
OUTPUT
ii) After delay time 100ms(by using Timer control)
INPUT
OUTPUT
1] B)
V. Find a even/Odd number.
INPUT
Option Explicit
Dim no As Integer
OUTPUT
VI. Find Factorial of number.
INPUT
Option Explicit
Dim a As Integer
Dim b As Integer
Dim i As Integer
INPUT
Option Explicit
Dim check As Integer
Dim num As Integer
Dim i As Integer
INPUT
Option Explicit
Dim n As Integer
Dim dis As Single
Dim tp As Single
OUTPUT
B] Design a form for speed control program using scrollbars.
INPUT
Private Sub Command1_Click()
HScroll1.Enabled = True
HScroll1.Value = 1
End Sub
INPUT
INPUT
Private Sub Option1_Click()
If Option1.Value = True Then
Text1.ForeColor = vbRed
Else
Text1.ForeColor = vbBlack
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
Text1.ForeColor = vbBlue
Else
Text1.ForeColor = vbBlack
End If
End Sub
Private Sub Option3_Click()
If Option3.Value = True Then
Text1.ForeColor = vbMagenta
Else
Text1.ForeColor = vbBlack
End If
End Sub
Private Sub Option4_Click()
If Option4.Value = True Then
Text1.ForeColor = vbYellow
Else
Text1.ForeColor = vbBlack
End If
End Sub
Private Sub Option5_Click()
If Option5.Value = True Then
Text1.ForeColor = vbGreen
Else
Text1.ForeColor = vbBlack
End If
End Sub
OUTPUT
4]A] Write a program in VB to build application to display sorted list of group A & group B
student in two list boxes. Make provision to shift name(s) on either side using ListBox control.
INPUT
Option Explicit
Dim i As Integer
If Combo2.ListIndex = 0 Then
Text2.Text = ""
Text2.Text = "Maharashtra"
ElseIf Combo2.ListIndex = 1 Then
Text2.Text = ""
Text2.Text = "Madhya Pradesh"
ElseIf Combo2.ListIndex = 2 Then
Text2.Text = ""
Text2.Text = "Gujrat"
ElseIf Combo2.ListIndex = 3 Then
Text2.Text = ""
Text2.Text = "Rajasthan"
ElseIf Combo2.ListIndex = 4 Then
Text2.Text = ""
Text2.Text = "Andhra Pradesh"
End If
End Sub
Combo2.AddItem "Nagpur"
Combo2.AddItem "Bhopal"
Combo2.AddItem "Ahmedabad"
Combo2.AddItem "Jaipur"
Combo2.AddItem "Hyderabad"
End Sub
OUTPUT
5]A] Write a VB Program to create an array of N elements. Find the frequency of element and
display the positions in an array.
INPUT
Option Explicit
Dim a(5) As Integer
Dim i As Integer
Dim n As Integer
Dim cnt As Integer
For i = 1 To Len(duptext)
If Mid(duptext, i, 1) = "" Then
If Mid(duptext, i - 1, 1) <> "" Then
countword = countword + 1
End If
End If
Next
End If
MsgBox "Number of characters:" &countchar&vbNewLine& "Number of words:" &countword
End Sub
OUTPUT
6] Create Menus using editor as follows.
And Write appropriate code on click event of New & Edit Menu Options.
INPUT
Private Sub menuexit_Click()
Unload Me
End Sub
OUTPUT
7] Create a database pay.mdb using Visual Database Manager with fields code number pay(n),
Name of Emplyoee(T), Designation(T), Address(T), Joining date(T), Basics pay(n), Status(T)
[Permanent / Temporary], Department(T), [purchase, sales, account]. Achieve connectivity
using Data control. Develop an application in V.B to display the data of employee using
MSFlexgrid control as shown below with company’s logo.
OUTPUT
8] Design a Menu as shown below.
Create table pay.mdb using Visual Data Manager and connect it to V.B application using Data
Control. Display/view records using DbGridControl.
Create an application in V.B to open database of employee pay.mdb by using menu option
“OPEN”. Use APPEND and SAVE options to ADD & SAVE records in Database.
INPUT
Private Sub menuappend_Click()
Adodc1.Recordset.AddNew
Text1.Text
End Sub
INPUT
Private Sub menuexit_Click()
Unload Me
End Sub
Data1.Recordset.MoveFirst
Do While Not Data1.Recordset.EOF
Class = Data1.Recordset.Fields(1).Value
If StrComp(Class, "BSC-1") = 0 Then
sum1 = Val(sum1 + Data1.Recordset.Fields(2).Value)
ElseIf StrComp(Class, "BSC-2") = 0 Then
sum2 = Val(sum2 + Data1.Recordset.Fields(2).Value)
ElseIf StrComp(Class, "BSC-3") = 0 Then
sum3 = Val(sum3 + Data1.Recordset.Fields(2).Value)
End If
Data1.Recordset.MoveNext
Loop
MsgBox "Total Fees of BSC-1=" & sum1, vbInformation, "Result"
MsgBox "Total Fees of BSC-2=" & sum2, vbInformation, "Result"
MsgBox "Total Fees of BSC-3=" & sum3, vbInformation, "Result"
End Sub
INPUT
Private Sub Command1_Click()
Data1.Recordset.Edit
End Sub
INPUT
Private Sub menudelete_Click()
Form2.Show
End Sub