i'll be adding to it as I learn things, so I can cement them in my mind.
First I will explain a few ways of making it so that the window in your form always stays on top, and then goes back to normal.
Create a windows application.
Method #1: put a checkbox and a button in your form. Click the checkbox and in it's properties you will see text (towards the bottom of the 'properties). Change it's name to 'always on top'. In the same way, change the button to say 'set'.
Double click the button to bring up it's code. Type this:
Code: Select all
If CheckBox1.Checked = True Then
Me.TopMost = "True"
Else
Me.TopMost = "False"
End If
'If CheckBox1.Checked = True Then'=If the box is checked then,
Me=the form that the button is in, example 'form1'.
Topmost=an option within the properties of form1
True=That option is set to be engaged
Else- or else
False=the opposite of true.
End If=the end of the statement
Now let's make popup message boxes for each of the scenarios.
Update the code to say this:
Code: Select all
If CheckBox1.Checked = True Then
Me.TopMost = "True"
MsgBox("Your window will now stay on top", vbExclamation, "Your preference has been changed")
Else
Me.TopMost = "False"
MsgBox("Your window will no longer stay on top", vbExclamation, "Your preference has been changed")
End If
MsgBox=Message Box
""#1 = text to be displayed
vbExclamation=type of message icon
""#2 = Title of message
Actually that's the only method I'm going to show for that, because we should be learning other things.
Now we are going to make it so there is a toolbar, and if you hit file>options it will open a new window with some options in it.
Into your form, add a 'MenuStrip'. A box will appear that says 'type here'. Click on it and type 'file' then hit enter. below the design window click something called MenuStrip1. click the box directly below file and type 'options' en hit enter. click file, then double click options.
Before you write anything, go to Project>Add Windows form and add a standard one.
Now go back to the code we were at and enter this:
Code: Select all
Form2.Visible = True
Time to make some options in form2 that edit form1.
create a label and four buttons.
make the label say:
'choose background color'
make the buttons say green, red, blue, and done
double click the green button and type
Code: Select all
Form1.BackColor = Color.Lime
Code: Select all
Form1.BackColor = Color.Red
double click done and enter
Code: Select all
Me.Visible = False
that's it for now, but more to come! Try it out!