Showing posts with label box. Show all posts
Showing posts with label box. Show all posts

Tuesday, February 22, 2011

Write a Visual Basic program for making a combo box which contains the country names and shows the capital for corresoponding country in another comb

WAP for making a combo box which contains the country names and shows the capital for corresoponding country in another combo box.
_______________________________________________________________



Private Sub Command1_Click()
If Combo1.ListIndex = 0 Then
Combo2.Clear
Combo2.AddItem ("NEW DELHI")
ElseIf Combo1.ListIndex = 1 Then
Combo2.Clear
Combo2.AddItem ("ISLAMABAD")
ElseIf Combo1.ListIndex = 2 Then
Combo2.Clear
Combo2.AddItem ("COLOMOW")
ElseIf Combo1.ListIndex = 3 Then
Combo2.Clear
Combo2.AddItem ("KATHMANDU")
ElseIf Combo1.ListIndex = 4 Then
Combo2.Clear
Combo2.AddItem ("TOKYO")
Else
MsgBox ("Select Valid Country")
End If
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Form_Load()
Combo1.AddItem ("INDIA")
Combo1.AddItem ("PAKISTAN")
Combo1.AddItem ("SRILANKA")
Combo1.AddItem ("NEPAL")
Combo1.AddItem ("JAPAN")
End Sub

_________________________________________________
OUTPUT
_________________________________________________


____________________________________
DOWNLOAD
____________________________________

Download its form

Download its Image



Write a Visual Basic Program to add text in a list and remove it from the list and to clear the list

WAP to add text in a list and remove it from the list and to clear the list.
___________________________________________________________

Private Sub Command1_Click()
a = InputBox("ENTER Item in the List BOX")
List1.AddItem (a)
End Sub

Private Sub Command2_Click()
List1.Clear
End Sub

Private Sub Command3_Click()
List1.RemoveItem (List1.ListIndex)
End Sub

Private Sub Command4_Click()
End
End Sub

Private Sub Form_Load()

End Sub

___________________________________________
OUTPUT
___________________________________________


____________________________________
DOWNLOAD
____________________________________

Download its form

Download its Image