0% found this document useful (0 votes)
3 views

Lab 01

The document outlines instructions for creating a form with various properties, including changing the form's title, background color, and button properties. It also details how to manipulate textboxes and implement functionalities such as showing/hiding elements and changing the form title based on user input. Additionally, it explains the use of group boxes and panels for organizing controls within the form.

Uploaded by

Ahmed Al-nasheri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lab 01

The document outlines instructions for creating a form with various properties, including changing the form's title, background color, and button properties. It also details how to manipulate textboxes and implement functionalities such as showing/hiding elements and changing the form title based on user input. Additionally, it explains the use of group boxes and panels for organizing controls within the form.

Uploaded by

Ahmed Al-nasheri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Lab 1_1

Form, Buttons and labels Properties

Changing properties through properties window:

1. Change the following Form properties:


a) Change the form title to “worksheet1” (text).
b) Set the Background color to blue (BackColor).
c) Set the font color to red (ForeColor).
d) Change e font style (Font)
e) Set the form size to 300 x 300 (Size).
f) Specify the Maximum form Size to be 500 x 500 (MaximumSize).
g) Specify the Minimum form Size to be 100 x 100 (MinimumSize).

2. Place three Buttons on the form, and change their properties as follows:
a) Change buttons titles to “Ok, Exit, Disable “(text).
b) Change buttons names to “Ok, Ex, Dis “(Name).
c) Set the buttons size to 50 x 50 (size).
d) Set the location for the ok button to be 60,60. And the Exit button to be
150,60.
e) Disable any button and notice the change (Enable).
f) Set the visible property to be false for any button and notice the change
(visible).

3. Drag a label on the form:


a) Write the following text on it:” welcome to project 1”.
b) Change the Autosize property to false.
c) Change font style, color and alignment.

Changing properties at run time:


Write the appropriate code to apply the following:

a) Insert a button that changes the Form’s background color.


b) Insert a button that hides\shows the label.
c) Disable button will disable the “Hide” button.
d) The Ok button shows a welcome message.
e) Exit button closes the form.

Textboxes Properties and Exercises

Changing properties through properties window:

4. Drag a Textbox to the current form, and change the following Form
properties:
h) Enable your textbox to contain several lines (Multiline)
i) Show scrollbars in the textbox (ScrollBars).
j) Enable your textbox to create a new line whenever you reach the border.
(WordWrap).
k) Add a default value to your textbox (Text).
l) Change the font color in the textbox (forecolor)
m) Forbid user to write in the textbox (Readonly)
n) Forbid user access to the textbox (Enabled)
o) Use your textbox for entering a password (PasswordChar)
p) Use your textbox for entering a password, using the system symbol
(UseSystemPasswordChar).
q) Add other 3 textboxes.
r) Change the TabIndex property for each textbox, so that the navigation
between them will change.

Exercise 1:
Create the following form:

Add code that does the following:

a) Change Title: Changes the title of the form according to the text entered in
the textbox (title).
b) Show/Hide: Shows and hides the label, the textbox and the button of the
Title.
c) Join: Joins the first name and last name inserted in the textboxes, and stores
the results in Full Name.
a. Use + operator
b. Use AppendText Method.
d) Go to Title: transfers the focus to Title Textbox
e) Repeat the code written in Join button, so that it occurs in "Textchanged"
event.
Group boxes and panels

Group boxes and panels: are used to group and contain controls, when moving
them all controls (inside them) moves.
Create the following form that contains a group box and a panel.

Notice the differences between them through the following properties:

Group box Caption No Same border


Scrollbar

panel No caption Scrollbars Change border

Exercise:

Add a Button "Hide", in the form above, to hide the "Greetings GroupBox".

You might also like