Visual BASIC Program Page 4

Visual BASIC Program Page 4

Visual BASIC Program Page 4

To view other topics related to Computer. Click Here.

Visual BASIC Program to choose from multiple selection.

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

Visual BASIC Program 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

Visual BASIC 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

Visual BASIC 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

Visual BASIC 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

Visual BASIC 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

Visual BASIC Program 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

Visual BASIC Program 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

Post a Comment

Previous Post Next Post