MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail...

13
Check boxes, radio button MsgBox, Input MsgBox, Input Box Functions Box Functions Lab 3 Ismail M. Romi: PPU- IT Dept

description

Radio Button A control used to permit the selection of one option from several choices Radio buttons appears in groups ( two or more) to represent mutually exclusive choices (one button in the group always selected) Radio buttons can be grouped by placing them in a frame Checked property: Selected = True / Unselected = False Text property What is displayed next to the radio button

Transcript of MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail...

Page 1: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Check boxes, radio button MsgBox, Input Box FunctionsMsgBox, Input Box Functions

Lab 3

Ismail M. Romi: PPU- IT Dept

Page 2: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Check Box

Allows the user to select or deselect one or more items in any group

Checked propertyChecked = TrueUnchecked = False

Text property for the text you want to appear next to the box

Page 3: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Radio ButtonA control used to permit the selection of one option from

several choicesRadio buttons appears in groups ( two or more) to

represent mutually exclusive choices (one button in the group always selected)

Radio buttons can be grouped by placing them in a frameChecked property:

Selected = True / Unselected = FalseText property

What is displayed next to the radio button

Page 4: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Group Box

Used as containers for other controls such as radio buttons and check boxes

Improves readability of form by separating the controls into logical groups

Page 5: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Borders and Styles

Most controls can appear to be three-dimensional or flat

Labels, text boxes, and pictures boxes all have a BorderStyle property with different style choices including:NoneFixedSingleFixed3D properties can be changed to the style of

choosing

Page 6: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Setting the Form's Screen Location

You can set the form’s screen position by setting the StartPositionproperty of the form

To center a form on the user’s screen, set the StartPosition property to CenterScreen

Page 7: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

MsgBox() FunctionMsgBox() Function

A function that produces a message box.Message Box:

A small dialog box used for output during a program’s execution.

Page 8: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Syntax

IntResponse=MsgBox(“prompt”[, Buttons] [,Title]

IntResponse: Integer return value from MsgBox function (1: OK, 2: Cancel, 3: Abort, 4: Retry, 5:Ignore, 6:Yes, 7: No)

Page 9: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

InputBox( ) Function

A message box with a field, in which the user can type a value.

Page 10: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Syntax:Var = InputBox(prompt [,MsgBoxTitle][,Title]

[,DefaultVal][,Xpos][,Ypos])Example:stdName = InputBox("enter student name", "student

record", "ali", 100, 200)

Page 11: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Creating ToolTips

Small label that is displayed when user pauses mouse pointer over a controlAdd a ToolTip Control to Form The new control appears in a new pane, Component Tray that

opens at the bottom of the Form DesignerAfter you add the component to your form, each of the form’s

controls has a new propertySelect ToolTip on ToolTip1 property of each control and add

Tool Tip comments

Page 12: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Changing the Color of Text

ForeColor and BackColor PropertiesUse VB Color Constants from the Color ClassType the keyword Color and a period in the

editor to view a full color list

nameTextBox.ForeColor = Color.RedmessageLabel.ForeColor = Color.White

Page 13: MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M.…

Lab Training

Questions:You have the following data for student record:Student number, Student name, Major (IS, IT,

Graphics), Courses: (Arabic: 2 credit hours, English 3 credit hours, VB: 3 credit hours).

Design a VB project to accept student data and grades, then calculate the average.

Notes:- After calculation, prevent any change to the entered data. - Use msgbox function and input box function where

required.