Feed Headline Animator

WAP to choose to multiple slection.

Private Sub Command1_Click()
List1.Clear
End Sub

Private Sub Command2_Click()
If Check1.Value = 1 Then List1.AddItem Check1.Caption
If Check2.Value = 1 Then List1.AddItem Check2.Caption
If Check3.Value = 1 Then List1.AddItem Check3.Caption
If Check4.Value = 1 Then List1.AddItem Check4.Caption
End Sub



Posted by: Wasim Javed

WAP to Build a computer system.

Private Sub Command1_Click()
Dim disk As String
Dim monitor As String
Dim proc As String
Dim str As String
str = ""
If Check1.Value = 1 Then str = str + Check1.Caption + Chr(13)
If Check2.Value = 1 Then str = str + Check2.Caption + Chr(13)
If Check3.Value = 1 Then str = str + Check3.Caption + Chr(13)
If Check4.Value = 1 Then str = str + Check4.Caption + Chr(13)
If Check5.Value = 1 Then str = str + Check5.Caption + Chr(13)
If Check6.Value = 1 Then str = str + Check6.Caption + Chr(13)
If Option1.Value = True Then
str = str + Option1.Caption + Chr(13)
ElseIf Option2.Value = True Then str = str + Option2.Caption + Chr(13)
ElseIf Option3.Value = True Then str = str + Option3.Caption + Chr(13)
ElseIf Option4.Value = True Then str = str + Option4.Caption + Chr(13)
ElseIf Option5.Value = True Then str = str + Option5.Caption + Chr(13)
ElseIf Option6.Value = True Then str = str + Option6.Caption + Chr(13)
End If
If Option7.Value = ture Then
str = str + Option7.Caption + Chr(13)
ElseIf Option8.Value = True Then str = str + Option8.Caption + Chr(13)
ElseIf Option9.Value = True Then str = str + Option9.Caption + Chr(13)
End If
MsgBox "You have selected" & Chr(13) & str
End Sub

Private Sub Command2_Click()
End
End Sub



Posted by: Wasim Javed

Write a program to make file list box and drive list box ?

Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
List1.AddItem File1.FileName
End Sub


Posted by: Wasim Javed

Write a program to make scroll bar and horizontal bar ?

Private Sub HScroll1_Change()
Label1.Left = HScroll1.Value
End Sub

Private Sub VScroll1_Change()
Label1.Top = VScroll1.Value
End Sub


Posted by: Wasim Javed

Write a program to display first ten natural number through loop ?

Private Sub Command1_Click()
For i = 1 To 10
List1.AddItem i
Next i
End Sub


Posted by: Wasim Javed

Write a program to compute the basic pay ?

Private Sub Command1_Click()
Dim bp, hr, ma, ca, net As Integer
If Option1.Value = True Then
bp = 5000
ElseIf Option2.Value = True Then
bp = 3000
ElseIf Option3.Value = True Then
bp = 1500
End If
net = bp
If Check1.Value = 1 Then net = net + bp * 0.45
If Check2.Value = 1 Then net = net + bp * 0.02
If Check3.Value = 1 Then net = net + bp * 0.15
Text1.Text = net
End Sub


Posted by: Wasim Javed

WAP to do arithmetic calculation

Private Sub Option1_Click()
Label3.Caption = Option1.Caption
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End Sub

Private Sub Option2_Click()
Label3.Caption = Option2.Caption
Text3.Text = Val(Text1.Text) - Val(Text2.Text)
End Sub

Private Sub Option3_Click()
Label3.Caption = Option3.Caption
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub

Private Sub Option4_Click()
Label3.Caption = Option4.Caption
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End Sub


Posted by: Wasim Javed

WAP to find option button events

Private Sub Command1_Click()
If Option1.Value = True Then
MsgBox "You selected " & Option1.Caption
ElseIf Option2.Value = True Then
MsgBox "You selsected " & Option2.Caption
ElseIf Option3.Value = True Then
MsgBox "You selected" & Option3.Caption
End If
End Sub


Posted by: Wasim Javed

WAP to find check box events (Fruit Shop)

Private Sub Command1_Click()
Dim str As String
str = ""
If Check1.Value = 1 Then
str = str & Check1.Caption & Chr(13)
End If
If Check2.Value = 1 Then
str = str & Check2.Caption & Chr(13)
End If
If Check3.Value = 1 Then
str = str & Check3.Caption & Chr(13)
End If
MsgBox "You have selected :" & Chr(13) & str
End Sub


Posted by: Wasim Javed

WAP to enter password

Private Sub cmdvalid_Click()
Dim response As Integer
If txtpassword.Text = txtpassword.Tag Then
MsgBox "valid password", vbOKOnly + -vbExclamation, "Access Allowed"
Else
response = MsgBox("incorrect password", vcbRetrycancel - vbCritical, "Access Denied")
If response = vbRetry Then
txtpassword.SelStart = 0
txtpassword.SelLength = Len(txtpassword.Text)
Else
End
End If
End If
txtpassword.SetFocus
End Sub


Posted by: Wasim Javed

WAP to display time on the screen

Private Sub Timer1_Timer()
Label1.Caption = Time
End Sub

Posted by: Wasim Javed

WAP to find label events

Private Sub Command1_Click()
Label1.Caption = Command1.Caption
End Sub

Private Sub Command2_Click()
Label1.Caption = Command2.Caption
End Sub


Posted by: Wasim Javed

Program

Private Sub Command1_Click()
Form1.Caption = Command1.Caption
End Sub

Private Sub Command2_Click()
Form1.Caption = Command2.Caption
End Sub

WAP to find inner/outer loop(nested loops)

Private Sub Command1_Click()
For outerloop = 1 To 3
Print "Outerloop counter variable ="; outerloop
For innerloop = 1 To 2
Print "innerloop counter variable="; innerloop
Next innerloop
Next outerloop
End Sub


Posted by: Wasim Javed

WAP to display first ten odd no

Private Sub Command1_Click()
Dim r As Integer
Dim n As Integer
n = 1
Do
r = n Mod 2
If r = 1 Then Print n
n = n + 1
Loop Until n > 10
End Sub


Posted by: Wasim Javed

Write a program to enter the password ?

Private Sub cmdexit_Click()
End
End Sub

Private Sub cmdvalid_Click()
Dim response As Integer
If txtpassword.Text = txtpassword.Tag Then
MsgBox "Valid password", vbOKOnly + -vbExclamation, "Access Allowed"
Else
response = MsgBox("Incorrect Password", vbRetryCancel - vbCritical, "Access Denied")
If response = vbRetry Then
txtpassword.SelStart = 0
txtpassword.SelLength = Len(txtpassword.Text)
Else
End
End If
End If
txtpassword.SetFocus
End Sub

Private Sub Form_Activate()
txtpassword.SetFocus
End Sub


Posted by: Wasim Javed

To display the time on the screen ?

Private Sub Timer1_Timer()
Label1.Caption = Time
End Sub


Posted by: Wasim Javed

Write a program to find the percentage through select case is ?

Private Sub Command1_Click()
marks = InputBox("Enter obtained marks")
Select Case marks
Case Is < 33
MsgBox "Fail"
Case Is >= 33, Is <= 49
MsgBox "Third Division"
Case Is >= 50, Is <= 59
MsgBox "Second Division"
Case Is >= 60
MsgBox "First Division"
Case Else
MsgBox "Not a valid marks percentage"
End Select
End Sub


Posted by: Wasim Javed

WAP to find the factorial by using next loop statements.

Private Sub Command1_Click()
Dim f As Long, n As Long, i As Long
n = InputBox("Enter as integer", "Factorial")
f = 1
For i = n To 1 Step -1
f = f * i
Next
MsgBox ("Factorial of " & n & "is" & f)
End Sub


Posted by: Wasim Javed

WAP to find sum of first ten even numbers.

Private Sub Command1_Click()
Dim r As Integer
Dim n As Integer
Dim s As Integer
s = 0
n = 1
Do
r = n Mod 2
If r = o Then s = s + n
n = n + 1
Loop While n <= 10
MsgBox ("Sum of first ten even number is " & s)
End Sub


Posted by: Wasim Javed

WAP to print first ten natural number on the screen.

Private Sub Command1_Click()
Dim a As Integer
n = 1
Do Until n > 10
Print n
n = n + 1
Loop
End Sub


Posted by: Wasim Javed

Write a program to find the days of week through select statement

Private Sub Command1_Click()
week = InputBox("Enter No of day")
Select Case week
Case 1
MsgBox "Monday"
Case 2
MsgBox "Tuesday"
Case 3
MsgBox "Wednesday"
Case 4
MsgBox "Thursday"
Case 5
MsgBox "Friday"
Case 6
MsgBox "Saturday"
Case 7
MsgBox "Sunday"
Case Else
MsgBox "Not a valid day number"
End Select
End Sub


Posted by: Wasim Javed

WAP to find factorial of a given number.

Private Sub Command1_Click()
Dim f As Long, n As Long
n = InputBox("enter as integer", "Factorial")
f = 1
Do While n > 1
f = f * n
n = n - 1
Loop
MsgBox ("Factorial of the integer is " & f)
End Sub


Posted by: Wasim Javed

WAP to print tables of a given number.

Private Sub Command1_Click()
Dim t As Integer
Dim n As Integer
t = InputBox("Enter number to print table")
Form1.Caption = "table of " & t
n = 1
Cls
While n <= 10
Print t, "X", n, "=", t * n
n = n + 1
Wend
End Sub


Posted by: Wasim Javed

WAP to find grade

Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim e As Integer
a = InputBox("Enter first value", "first value")
b = InputBox("Enter second value", "second value")
c = InputBox("Enter third value", "third value")
d = InputBox("Enter fourth value", "fourth value")
e = InputBox("Enter fifth value", "fifth value")
If a < 70 Then
MsgBox ("Fail")
ElseIf a < 80 Then
MsgBox ("Grade=c")
ElseIf a < 90 Then
MsgBox ("Grade=b")
Else
MsgBox ("Grade=a")
End If
End Sub


Posted by: Wasim Javed