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

Menu Building Pt.4 Coding Custom Messagebox

Icon Leave Comment
So for the Messagebox Form we have to run some code on the form load
Private Sub frmcheese_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Left = (Screen.PrimaryScreen.WorkingArea.Width - Me.Width) / 2
        Me.Top = (Screen.PrimaryScreen.WorkingArea.Height - Me.Height) / 2
        frmSandwhichBuilder.Enabled = False
        Me.Text = frmSandwhichBuilder.Cheesename
    End Sub



Explaination
Spoiler


Do a test run to make sure that everything works. When it does, then we can continue.

So now we have to add functionallity to the Buttons

Cancel
 Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        frmSandwhichBuilder.checktype.checked = False
        frmSandwhichBuilder.Enabled = True
        Me.Close()
    End Sub


Clicking cancel is basically changing your mind and therefore unchecks the Checkbox and re-enables the Builder Form while closing the Messagebox Form

But to answer the question "How would you like your cheese?"
We have choices Melted, Sliced, Shredded
Luckily the code for these three are the same
 frmSandwhichBuilder.Enabled = True
        Me.Close()

The Checkbox is already checked even before this Form loaded, so theres no more to do

So now we have Sauce and Cheese Groupboxes done. I left Meat alone except for asking how the Eggs are preferred done. (Scrambled, Over Easy, Sunny Side Up). And Asparagus asking if the Asparagus should be steamed or not.
For asparagus, I used the same format because it just wouldnt make sense to have a different style Messagebox to pop up

Now you are allowed to add any custom Messageboxes for whatever you want.

Next week I will go over Choosing Bread. Have a good weekend

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

    5 user(s) viewing

    5 Guests
    0 member(s)
    0 anonymous member(s)