So now I we are going to code the Cheese Group
Private Sub CheckAmerican_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckAmerican.CheckedChanged
If CheckAmerican.Checked = True Then
Cheese = Cheese + 1
Total = Total + 1
Cheesename = CheckAmerican.Text
frmCheese.Visible = True
End If
If CheckAmerican.Checked = False Then
Cheese = Cheese - 1
Total = Total - 1
End If
If Cheese = 3 Then
For Each CheckBox In groupCheese.Controls
If CheckBox.checked = False Then
CheckBox.enabled = False
End If
Next
Else
For Each CheckBox In groupCheese.Controls
CheckBox.Enabled = True
Next
End If
If Total = 9 Then
For Each CheckBox In groupTopping.Controls
If CheckBox.checked = False Then
CheckBox.enabled = False
End If
Next
For Each CheckBox In groupSauce.Controls
If CheckBox.checked = False Then
CheckBox.enabled = False
End If
Next
For Each CheckBox In groupMeat.Controls
If CheckBox.checked = False Then
CheckBox.enabled = False
End If
Next
For Each CheckBox In groupCheese.Controls
If CheckBox.checked = False Then
CheckBox.enabled = False
End If
Next
Else
If Cheese < 3 Then
For Each checkbox In groupCheese.Controls
checkbox.enabled = True
Next
End If
If Toppings < 3 Then
For Each checkbox In groupTopping.Controls
checkbox.enabled = True
Next
End If
If Sauce < 3 Then
For Each checkbox In groupSauce.Controls
checkbox.enabled = True
Next
End If
If Meat < 3 Then
For Each checkbox In groupMeat.Controls
checkbox.enabled = True
Next
End If
End If
End Sub
Theres one thing that you should take now thats different.
Cheesename = CheckAmerican.Text
frmCheese.Visible = True
Ok we didnt Dim or create a frmcheese. So we should do that now.
Make the dim and then create a new form and name it frmcheese. This Form is going to be an alternative Messagebox since the customization on Messageboxes in VB are very limited and too basic for what we are going to do
Custom Messagebox
https://drive.google...ZVJNRnFFQTQ2LXc
Frmcheese
BackColor: Firebrick
AutoValidate: EnabledAllowFocus
AutoScaleMode: Font
Size: 360, 145
ControlBox: False
MaximizeBox: False
MinimizeBox: False
SizeGripStyle: Hide
Now lets add 4 Buttons to the Form and 1 Label
Buttons
BackColor: Firebrick
Font: Century Schoolbook , 12
ForeColor: Yellow
Size: 247, 20
Give the buttons the text, "Melted", "Shredded", "Sliced", and "Cancel" and align them on the bottom.
Name them BtnMelted, BtnShredded, etc.
Now add the Label
Label
BackColor: Firebrick
Font: Century Schoolbook, 12
ForeColor: Yellow
Text: "How Would You Like Your Cheese?"
Name it lblTitle and align it in the center of the Form near the top
Now you have the Design for the Form and next I will get into the functionality
0 Comments On This Entry
Trackbacks for this entry [ Trackback URL ]
← January 2022 →
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 |
Tags
My Blog Links
Recent Entries
-
-
-
Menu Building Pt.4 Coding Custom Messageboxon Apr 15 2016 07:42 AM
-
Menu Building Pt. 3 Creating Custom Messageboxon Apr 11 2016 07:51 AM
-
Happy Weekendon Apr 08 2016 09:03 AM
Recent Comments
Search My Blog
8 user(s) viewing
8 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)



Leave Comment









|