Enter the data of checkbox into Listbox in vb6.0
Steps for the program of entering the data of checkbox into Listbox in vb6
- Open Microsoft visual basic 6.0
Draw the six checkboxes, one Listbox, and two buttons (here you can draw more controls as per your requirements)
After that write the code for the display button and clear button
Then run the program
Source code for How to enter the data of checkbox into Listbox in vb6
Private Sub Command1_Click()
If chk1 = vbChecked Then
List1.AddItem "Milk"
End If
If chk2 = vbChecked Then
List1.AddItem "Tea"
End If
If chk3 = vbChecked Then
List1.AddItem "Coffee"
End If
If chk4 = vbChecked Then
List1.AddItem "Soup"
End If
If chk5 = vbChecked Then
List1.AddItem "Juice"
End If
If chk6 = vbChecked Then
List1.AddItem "Cold Drink"
End If
End Sub
Private Sub Command2_Click()
List1.Clear
End SubHow to work the program of Listbox with checkbox in vb6
Why you need this program
We have to seen how to get the checked items in checklistbox nowhere see actually why you need this program. If you noticed that this type of program used in many places means billing software, booking application, management systems, etc. So, you realize that how much important this program.
Mostly if college students design their own projects then they are in checkbox and Listbox control by using this program concept you can clear your confusion and complete your project. I think now you can understand how to enter the data of the checkbox into Listbox in vb6 and why need this program.
This program also use you for many types exams, if in your exam asked this types question then don’t confuse because this program is asked in many formats like how to code multiple checkboxes in visual basic, how to show the checkbox in Listbox, How to get the checked items in checklistbox etc.
Conclusion
0 Comments