הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Question
Monday, July 6, 2015 10:07 PM
So I want to learn how to connect check boxes to a progress bar based on a actual percentage depending on the amount of check boxes. Please someone help!!!!!! Been everywhere and haven't understood anything.
Please help.
All replies (6)
Monday, July 6, 2015 10:16 PM ✅Answered
So I want to learn how to connect check boxes to a progress bar based on a actual percentage depending on the amount of check boxes.
Set the progress bar maximum to the number of check boxes. Count the checkboxes that are checked, and set that as the value of the progress bar. Depending on what these checkboxes do you can probably do everything in the one event handler.
Private Sub Form_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ProgressBar1.Maximum = 3
End Sub
Private Sub CheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles _
CheckBox1.CheckedChanged, _
CheckBox2.CheckedChanged, _
CheckBox3.CheckedChanged
Dim Count As Integer = 0
If CheckBox1.Checked Then Count += 1
If CheckBox2.Checked Then Count += 1
If CheckBox3.Checked Then Count += 1
Progressbar1.value = Count
End Sub
Monday, July 6, 2015 11:06 PM ✅Answered
Okay, now the second question I have is what do I have to do if I want to change around the check boxes to checked list boxes?
If your question has been answered you should mark one or more of the responses as answers and start a new thread for a new question.
You can't 'change' a check box to a checked list box. It's a new task. However, the process would be similar - set the progress bar maximum to the the number of rows in the checked list box and set the progress bar value to the number of checked rows.
The number of rows in the checked list box is the Count property of the Items collection, and the number of checked rows is the Count property of the CheckedItems collection.
Monday, July 6, 2015 10:17 PM
So I want to learn how to connect check boxes to a progress bar based on a actual percentage depending on the amount of check boxes. Please someone help!!!!!! Been everywhere and haven't understood anything.
Please help.
Please stop with all of the exclamation marks - that won't get you an answer any faster and honestly, it's annoying.
*****
Figure out the percentage in your code. You know how many checkboxes there are and in code you can determine how many of them are checked. It's pretty simple math then to know the percentage of checked relative to the count of all of them.
Set your progress bar for a minimum of 0, a maximum of 100, and a value of (the integer of) that percentage - scaled from 1 to 100.
Still lost in code, just at a little higher level.
:-)
Monday, July 6, 2015 10:31 PM
Okay, now the second question I have is what do I have to do if I want to change around the check boxes to checked list boxes? So that they would fill up a progress bar then in change that progress bar is a part of a larger progress bar. So by the end there is one major progress bar filled with smaller progress bars that all link to each other. In the end it would look like a pyramid of progress bars starting with one progress bar to two progress bars then to four progress bars. and finally there are four checked list boxes under each of the final progress bars. ??? Do you understand what I am trying to get at?
Monday, July 6, 2015 10:42 PM
Sorry about the Exclamations. But I want to change the check boxes to a check box list what changes would I have to use to make this correction.
Also, How do I link a progress bar to a second progress bar? Thank you for the help!
Monday, July 6, 2015 10:48 PM
Okay, now the second question I have is what do I have to do if I want to change around the check boxes to checked list boxes? So that they would fill up a progress bar then in change that progress bar is a part of a larger progress bar. So by the end there is one major progress bar filled with smaller progress bars that all link to each other. In the end it would look like a pyramid of progress bars starting with one progress bar to two progress bars then to four progress bars. and finally there are four checked list boxes under each of the final progress bars. ??? Do you understand what I am trying to get at?
No. Draw an image of it in a drawing app then insert the image in a post so it can be looked at. Use the Insert Image button in the ToolStrip at the top of a post being edited.
It appears you've been a member since 2011 so you should be able to do that.
In fact you can just add all the controls from the toolbox onto a Form in the order you want. Then screen copy that to a drawing app. Then place descriptions in the drawing of what each thing you want should do. And maybe explain it all in a reasonable way.
La vida loca