Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M. Romi: PPU- IT Dept."— Presentation transcript:

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

2 Check Box Allows the user to select or deselect one or more items in any group Checked property Checked = True Unchecked = False Text property for the text you want to appear next to the box

3 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

4 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

5 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: None FixedSingle Fixed3D properties can be changed to the style of choosing

6 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

7 MsgBox() Function A function that produces a message box. Message Box: A small dialog box used for output during a program’s execution.

8 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)

9 InputBox( ) Function A message box with a field, in which the user can type a value.

10 Syntax: Var = InputBox(prompt [,MsgBoxTitle][,Title][,DefaultVal][,Xpos][,Ypos]) Example: stdName = InputBox("enter student name", "student record", "ali", 100, 200)

11 Creating ToolTips Small label that is displayed when user pauses mouse pointer over a control Add a ToolTip Control to Form The new control appears in a new pane, Component Tray that opens at the bottom of the Form Designer After you add the component to your form, each of the form’s controls has a new property Select ToolTip on ToolTip1 property of each control and add Tool Tip comments

12 Changing the Color of Text ForeColor and BackColor Properties Use VB Color Constants from the Color Class Type the keyword Color and a period in the editor to view a full color list nameTextBox.ForeColor = Color.Red messageLabel.ForeColor = Color.White

13 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.


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

Similar presentations


Ads by Google