DotNetWebTutor.com                                                    Link to Us

Form Styles
Forms have various styles to choose from
formBorderStyle

  1. none
    1. no border
    2. cannot resize
    3. no control buttons

 

form styles=none

  1. fixedsingle
    1. cannot be resized

 

formstyle = fixedsingle

  1. Fixed3D
    1. Cannot be resized

 

formstyle = fixed3d

  1. fixedDialog
    1. cannot be resized
    2. no controlbox
    3. can have min and max buttons
    4.  

formstyle = fixeddialog

  1. Sizable
    1. Default setting
    2.  

formstyle = sizable

  1. FixedToolWindow
    1. Cannot be resized
    2. Only has close box
    3.  

formstyle = fixedtoolwindow

  1. SizableToolWindow
    1. Resizable
    2. Only close box

 

formstyle = sizabletoolwindow

Controlbox
When set to false it removes the close, max and min buttons from the form
controlbox = true
true
controlbox = false
false

maximizeBox
Boolean value if to display the maximize button
maximizebox
minimizeBox
Boolean value if to display the minimize button
minimizebox
MaximumSize
Limit how big you can resize the form

MinimumSize
Limit how small you can resize a form

Opacity
0-100
the degree of transparency a form has
ex: myForm.opacity=0.3

topmost
if true it keeps the form on the top always

resizing
myForm.width=300
myForm.Height=300
or
myForm.size=new size(300,300)

Anchoring and docking allow controls to adjust when the form resizes
Programmer usually design for 800x600 or 1024x768
You can react to a form changing size

Example
Start a new project
Add a button
Click the form and in the properties window click the lightning bolt to take you to the forms events
events icon - lightning bolt
Double click to the right of SizeChanged event
size_changed
Add the following code:
Button1.Width = ClientSize.Width / 2

Click the property button to return your property window back to normal
property button