Group Boxes, Radio buttons and Checked List Boxes

Slides:



Advertisements
Similar presentations
Group Boxes and Panels Arrange components on a GUI Buttons and etc. can be placed inside a group box or panel. All these buttons move together when the.
Advertisements

To type the VB code behind the command button (named cmdPush), Double-Click on the Push Me (caption) command button As a result the Visual Basic Code Window.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 3 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Chapter 3 Week 13 Tariq Aziz and Kevin Jones.
Adding Controls to User Forms. Adding Controls A user form isn’t much use without some controls We’re going to add controls and write code for them Note.
Adobe Forms THE FORM ELEMENT PANEL. Creating a form using the Adobe FormsCentral is a quick and easy way to distribute a variety of forms including surveys.
Visual Basic Chapter 1 Mr. Wangler.
05/09/ Introducing Visual Basic Sequence Programming.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Lab 9 – User Forms Design. User Forms What are user forms? –Known as dialog boxes –Major ways for getting user input An example of using user forms: Monthly.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
Chapter 3 Introducing Visual Basic.NET. 3.1 Visual Basic.NET Windows Programming -Used to create Windows, Web, and Console applications -Uses predefined.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
How to get started with Excel VBA. We need to enable programming in Excel  the “Developer menu”
Chapter 2 P. 1 Introducing more controls (on the Toolbox) (Fig. 2.1) - Text box - Frame - Option button - Check box - Image Example P. 44 Figure 2.2 Message.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Visual Basic CDA College Limassol Campus Lecture:Pelekanou Olga Semester C Week - 1.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
1 Visual Basic Part I - A tool for customizing your program Principles of GIS
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
1 Chapter 4 – Decisions 4.1 Relational and Logical Operators (see other set of slides) 4.2 If Blocks (see other set of slides) 4.3 Select Case Blocks (see.
2e – RadioButtons Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
1 CS 106 Computing Fundamentals II Chapter 210 “Adding Controls to User Forms” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
Chapter 2 More Controls Programming in C#. NET Objectives Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Using Option Buttons. Option Buttons Are similar to checkboxes. Must appear in groups. Only one button in the group can be selected at a time. Sometimes.
{ Power Point and Text Working with Text Boxes and Formatting Text.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
1 4.2 Selection Logical Operators. 2 Learning Objectives Explain how the logical operator AND Boolean statements works. Directly testing if text boxes.
21/03/ Working with Controls Text and List Boxes.
Programming with Visual Basic.NET. Quick Links Program Code The Code Window The Event Procedure Assignment Statements Using AutoList Radio Buttons Buttons.
Visual Basic.NET BASICS Lesson 9 Nested If Statements and Radio Buttons.
Making Billboards By Deborah Nelson Duke University, Under the direction of Professor Susan Rodger, July 14, 2008.
Chapter 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
Chapter 8 Multiple Forms, Modules, and Menus. Introduction This chapter demonstrates how to: – Add multiple forms to a project – Create a module to hold.
3.02 APPLY PROPERTIES ASSOCIATED WITH THE CONTROLS Computer Programming I.
Visual Basic.NET Windows Programming
Visual Studio 2010 Hello World CSC 230.
Apply Procedures to Develop Menus, List Box and Combo Box Objects
A First Look at GUI Applications Radio Buttons and Check Boxes
3.01 Apply Controls Associated With Visual Studio Form
How to design a Windows Forms application
3.01 Apply Controls Associated With Visual Studio Form
Visual studio 2010 SENG 403, Tutorial 2 SENG Winter 2011.
Apply Procedures to Develop Menus, List Box and Combo Box Objects
User Forms.
CHAPTER FIVE Decision Structures.
Visual Studio 2010 Hello World CSC 230.
Simple Windows Applications
Visual Basic Programming Chapter Four Notes Working with Variables, Constants, Data Types, and Expressions GROUPBOX CONTROL The _____________________________________.
Items, Group Boxes, Check Boxes & Radio Buttons
Visual C# - GUI and controls - 1
GUI Programming in Visual Studio .NET
CHAPTER FOUR VARIABLES AND CONSTANTS
3.2 Working with Data Scope of variables 29/07/2019.
Presentation transcript:

Group Boxes, Radio buttons and Checked List Boxes 2.2 Working with Controls Group Boxes, Radio buttons and Checked List Boxes 02/07/2019

Learning Objectives Know what radio buttons, checked list boxes and group boxes are used for; and how to use them. 02/07/2019

The Radio Button Used to allow the user to select one option from two or more options e.g. 02/07/2019

The Radio Button Properties Events Apart from the Name and Text properties the most useful property is Value. It holds true if selected or False if not. Events The click event is the only one you are likely to use. 02/07/2019

The Checked List Box Similar to the radio button in that you can test its Value property to see if it is selected. Unlike the radio button you can select more than one at a time. 02/07/2019

The Checked List Box A common use of a checked list box is setting general default values through the Tools/Options menu. Has similar properties and methods to the radio button. 02/07/2019

The Group Box The group box is a rectangular shape in which you usually place other controls. The last picture for example shows a group box named Window options. 02/07/2019

The Group Box Advantages are: Can reposition all controls at design time by just moving the group box. Can show or hide all the controls inside it at run-time by just showing or hiding the group box (Visible property). If you want two or more groups of radio buttons, so that one can be selected from each group, then you must put each group into a group box. Without group boxes you could only select one button from all the buttons on the form. 02/07/2019

Program 2.2 Radio buttons, group boxes and checked list boxes Specification: Demonstrate the use of two groups of radio buttons and a checked list box. Create a new project named ‘Forms’. Change the Form’s Text property to ‘Radio buttons, checked list and group boxes’. 02/07/2019

Program 2.2 Radio buttons, group boxes and checked list boxes Drag a GroupBox control from the toolbox and position and size it as shown. Drag and place two RadioButton controls from the ToolBox straight into the GroupBox as shown. 02/07/2019

Note I suggest that when you change the Text properties of any controls you also change the Bold property to True. To save space in the following instructions I have not stated this every time. 02/07/2019

Program 2.2 Radio buttons, group boxes and checked list boxes Change the Text property of the GroupBox control to ‘Gender’. Change the Name property of the first RadioButton control to ‘radMale’ and its Text property to ‘Male’. Change the Name property of the second RadioButton control to ‘radFemale’ and its Text property to ‘Female’. 02/07/2019

Note If you had first placed the RadioButtons outside the GroupBox and then moved them into the GroupBox, they would not belong to it. You must drag them straight from the ToolBox into the GroupBox. Try moving the GroupBox and both RadioButtons should move with it. 02/07/2019

Program 2.2 Radio buttons, group boxes and checked list boxes Place a Label below the GroupBox. Set its Name property to lblSelection, its BorderStyle property to FixedSingle and its Text property to blank. Double click the Male radio button. Type the following code in the procedure code template: lblSelection.Text = “You selected Male” 02/07/2019

Program 2.2 Radio buttons, group boxes and checked list boxes Return to Design view. Double click the Female radio button. Type the following code in the procedure code template: lblSelection.Text = “You selected Female” Run the program and test the two RadioButtons. 02/07/2019

Program 2.2 Radio buttons, group boxes and checked list boxes Place another GroupBox control to the form and change its Text property to Age as shown on the next slide. Place three RadioButtons controls in this GroupBox. Keep their default names but change their Text properties as shown on the next slide. 02/07/2019

Program 2.2 Radio buttons, group boxes and checked list boxes 02/07/2019

Program 2.2 Radio buttons, group boxes and checked list boxes Run the program and test the fact that you can select one RadioButton from each of the two groups (remember this is why we use GroupBoxes, otherwise you would only be able to choose one RadioButton from both groups). Place a third GroupBox control on the frame and change its Text property to Replies as shown on the next slide. 02/07/2019

Program 2.2 Radio buttons, group boxes and checked list boxes Place a CheckedListbox in the GroupBox and set its Items property as shown. 02/07/2019

Program 2.2 Radio buttons, group boxes and checked list boxes Run the program and test thoroughly. Save the program. Publish the program. 02/07/2019

Extensions Add another label below the Age group box to indicate which of the radio buttons is currently selected. Make the age group box and the label above invisible when the program runs. When the user first selects a gender option make the group box and label appear. 02/07/2019

Plenary What are radio buttons used for? Allow a user to select one option only from a list. What are group boxes used for? Hold groups of controls. 02/07/2019

Plenary What would happen if we didn’t place radio buttons (or other controls) in a group box? It would not be possible to select more than one radio button on a form. You would not be able to move groups of controls at once. 02/07/2019

Plenary What is the difference between radio buttons and checked boxes? You can only select one radio button from a group. You can select as many checked boxes as you like. 02/07/2019