Subscribe to [FP-0] Discotinued        RSS Feed
-----

Menu Building Pt. 3 Creating Custom Messagebox

Icon Leave Comment

Poll: Menu Building Pt. 3 Creating Custom Messagebox (0 member(s) have cast votes)

Whats your favorite cheese in general?

  1. American (0 votes [0%])

    Percentage of vote: 0%

  2. Blue (0 votes [0%])

    Percentage of vote: 0%

  3. Cheddar (0 votes [0%])

    Percentage of vote: 0%

  4. Colby Jack (0 votes [0%])

    Percentage of vote: 0%

  5. Mozzarella (0 votes [0%])

    Percentage of vote: 0%

  6. Munster (0 votes [0%])

    Percentage of vote: 0%

  7. Provolone (0 votes [0%])

    Percentage of vote: 0%

  8. Swiss (0 votes [0%])

    Percentage of vote: 0%

  9. Gauda (0 votes [0%])

    Percentage of vote: 0%

  10. Cottage (0 votes [0%])

    Percentage of vote: 0%

Vote Guests cannot vote
Welcome back, I hope you all had a good weekend!

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 ]

There are no Trackbacks for this entry

January 2022

S M T W T F S
      1
2345678
9101112131415
161718192021 22
23242526272829
3031     

Tags

    Recent Entries

    Recent Comments

    Search My Blog

    7 user(s) viewing

    7 Guests
    0 member(s)
    0 anonymous member(s)