Download - Lesson 3 identify parts of the visual basic work screen

Transcript
Page 1: Lesson 3   identify parts of the visual basic work screen

Identify Parts of the Visual Basic Work Screen

7.

6.

3.

1.

5.

2.

4.

Page 2: Lesson 3   identify parts of the visual basic work screen

1.

2.

3. 4. 5.

8.

7.

6.

Identify Parts of the Visual Basic Work Screen

Page 3: Lesson 3   identify parts of the visual basic work screen

Wordpool: Choose the answer on the list provided

1. Also known as radio button that allows the user to choose one among the given options.

2. Not a control but used to select controls to be put on a form.

3. A control that initiates an action when pressed or clicked.

4. Control that accept an input value to user.5. A control that is used to display images.6. Control that provides user with a choice.7. Control used to display text or caption.8. A prefix used for Form.9. A control that provides list of items.10. This control is used to hold controls in groups.

FrameCommandButtonOptionButtonPointerPictureBoxLabel TextBoxCheckBoxforfrmComboBoxHScrollBar

Page 4: Lesson 3   identify parts of the visual basic work screen

Create the names of the different control

Control Preferred Name1. Save CommandButton2. Name TextBox3. Gender OptionButon4. Age CheckBox5. Girlpicture PictureBox6. Company Label7. Exit CommandButton8. Department Textbox

Page 5: Lesson 3   identify parts of the visual basic work screen

Title Bar

Menu Bar

Standard BarToolbox Designer Window

Properties Window

Solution ExplorerWi

ndow

Error/Task List Window

Page 6: Lesson 3   identify parts of the visual basic work screen

Wordpool: Choose the answer on the list provided

1. Also known as radio button that allows the user to choose one among the given options.

2. Not a control but used to select controls to be put on a form.

3. A control that initiates an action when pressed or clicked.

4. Control that accept an input value to user.5. A control that is used to display images.6. Control that provides user with a choice.7. Control used to display text or caption.8. A prefix used for Form.9. A control that provides list of items.10. This control is used to hold controls in groups.

OptionButtonPointerCommandButtonTextBoxPictureBoxCheckBoxLabel frmComboBoxFrameImagebox

Page 7: Lesson 3   identify parts of the visual basic work screen

Create the names of the different control

Control Preferred Name1. Save CommandButton cmdsave2. Name TextBox txtname3. Gender OptionButon optgender4. Age CheckBox chkage5. Girlpicture PictureBox picgirlpicture6. Company Label lblcompany7. Exit CommandButton cmdexit8. Department Textbox txtdepartment

Page 8: Lesson 3   identify parts of the visual basic work screen

Events and Event ProceduresEvents – is the user’s action; it could be clicking,

double clicking or pressing a key on a keyboard.

Code – is the statement that carries out the action when the event is triggered.

Event Procedure – Adding a code in an event

Page 9: Lesson 3   identify parts of the visual basic work screen

Common Control Event Event DescriChangeption

Activate This event occurs when forms get a focus

Click This event occurs when the user click anywhere on the form or control.

Initialize This event occurs when the form is first generated.

Load This event occurs when the form is loaded into the computer’s memory and displays on the screen

Dblclick This event occurs when the user double-clicks the form or control

Deactivate This even occurs when another form gets the focus

Unload This event occurs when the form is terminated from the computer’s memory.

Resize This event occurs when the user changes the size of a form

Change This occurs when the user changes the test inside a textbox

Page 10: Lesson 3   identify parts of the visual basic work screen

The Code WindowProcedure is a section in the code window that holds assignment statements for a control to perform a specific task or action.

Page 11: Lesson 3   identify parts of the visual basic work screen

Object Box Procedure Box

• The word Private indicates that the procedure is solely for the selected object and form. It cannot be called up by other forms.

Page 12: Lesson 3   identify parts of the visual basic work screen

Object Box Procedure Box

• The word Sub on the first line indicates the beginning of the event procedure.

Page 13: Lesson 3   identify parts of the visual basic work screen

Object Box Procedure Box

•The cmddisplay indicates the control that will do the event.

Page 14: Lesson 3   identify parts of the visual basic work screen

Object Box Procedure Box

•The Click indicates the event that should occur to the object or control.

Page 15: Lesson 3   identify parts of the visual basic work screen

Object Box Procedure Box

•The End Sub or the last line indicates the termination of the event procedure.

Page 16: Lesson 3   identify parts of the visual basic work screen

Object Box Procedure Box

Adding Code or Procedure to an Event1. Double click on the control that you will insert a code. (or you may use the code window button on the project explorer.)

Page 17: Lesson 3   identify parts of the visual basic work screen

Object Box Procedure Box

Adding Code or Procedure to an Event2. On the code window the cursor is already set in between the private sub and end sub. The action that you want to occur in response to an event are known as assignment statements.

Page 18: Lesson 3   identify parts of the visual basic work screen

Object Box Procedure Box

Adding Code or Procedure to an Event2.This can be expressed as:Objectname.property = setting or property value

*This means assigning values to properties of an object.

Page 19: Lesson 3   identify parts of the visual basic work screen

Object Box Procedure Box

Adding Code or Procedure to an Event2.This can be expressed as:Objectname.property = setting or property value

*This means assigning values to properties of an object.

Page 20: Lesson 3   identify parts of the visual basic work screen

Object Box Procedure Box

Adding Code or Procedure to an Event3. After inserting your event procedure, go to toolbar and then try running your program by clicking the Start debugging button. (If there is a program error, program will not run successfully.