COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.

Slides:



Advertisements
Similar presentations
VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
Advertisements

Information System Design Lab 5&6. User Interface Design.
Chapter 1: An Introduction to Visual Basic 2012
Chapter 3.1 Controls Programming In Visual Basic.NET.
Chapter 2 More Controls Programming In Visual Basic.NET.
© by Pearson Education, Inc. All Rights Reserved. continued …
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
Chapter 2 More Controls Programming In Visual Basic.NET.
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.
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
Slide 1 Chapter 2 Visual Basic Interface. Slide 2 Chapter 2 Windows GUI  A GUI is a graphical user interface.  The interface is what appears on the.
Visual Basic Chapter 1 Mr. Wangler.
05/09/ Introducing Visual Basic Sequence Programming.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
CSCI 3328 Object Oriented Programming in C# Chapter 2: Introduction to Visual C# Programming 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg,
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
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.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
Visual Basic.net Textbox & Label Controls. Textbox Naming convention (txt) Primary use (user input) Can except numeric and character values.
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”
Chapter Two Creating a First Project in Visual Basic.
CHAPTER FIVE Specifying Alternate Courses of Action: Selection Statements.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
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.
What is Visual Basic.NET? 110 B-1 e.g. a word processor doesn’t do anything until the user clicks on a button, types text... A programming language that.
More Controls and Their Properties Part 4 dbg --- TextBox, CheckBox, RadioButton, GroupBox, ToolTips,
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Visual Basic CDA College Limassol Campus Lecture:Pelekanou Olga Semester C Week - 1.
Class 2 Remote Instruction Review of Working with Buttons EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure.
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.
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.
BBT 10 Visual Basic 03 Enrichment. Tip Before creating any files for your project, first create a new folder Save all of your files in the folder Pieces.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
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.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
3.02 APPLY PROPERTIES ASSOCIATED WITH THE CONTROLS Computer Programming I.
Chapter 1: An Introduction to Visual Basic .NET
Visual Basic.NET Windows Programming
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Object Orientated Programming using C#
Chapter 1: An Introduction to Visual Basic 2015
CSCI 3328 Object Oriented Programming in C# Chapter 2: Introduction to Visual C# Programming UTPA – Fall 2012 This set of slides is revised from lecture.
Chapter 8: Writing Graphical User Interfaces
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Chapter 3 Fundamentals of Programming in Visual Basic 3
Visual programming Chapter 3: GUI (Graphical User Interface) Part I
Chapter 2 Visual Basic Interface
The University of Texas – Pan American
Building an Application in the Visual Basic .NET Environment
Introduction to Programming
Programming In Visual Basic.NET
Group Boxes, Radio buttons and Checked List Boxes
Presentation transcript:

COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls

Essential Standard and Objectives Essential Standard Apply Procedures To Construct Windows Form 3.02 Apply Properties Associated with the Controls (3%)

Form Control Every application will have at least one form which is automatically included. A form is a graphical object that contains a title bar, a system menu and minimize, maximize and close buttons. The project Design window displays the Form object. Click to select. A selected object displays handles that appear as squares. – You can drag a side handle to change the size.

Form Control The properties of the Form object define its appearance, behavior, position and other attributes. To set a property value  Type or select a new value in the Properties window.

The Form Control Form Control Properties  Name  Text is displayed in the title bar on top.  BackColor changes the color of the form background Set the properties in the Properties window or during runtime. Ex: BackColor = Color.Azure

The Label Control The label allows you to display information or prompt the user. Label Control Properties  ( Name ) should begin with lbl (lblPrompt).  Text is the text displayed in the label.  Font defines the font name, style, and size of the label text.  Autosize sizes the label to fit its text. Can be set to False so that the label size does not change.  TextAlign sets the alignment of the text within the label. Set the properties in the Properties window.

The Label Control

Using the Label Control VB You wills use the label to display a message, information or a prompt. Syntax for a label lblName.Text = “message/info/prompt here” To put your message on multiple lines, add vbCrlf using the & to join the “pieces” The vbCrlf is built in Visual Basic and moves the text to the next line. lblInfo.Text = “message” & vbCrlf & “info”

The Button Control Button control properties  ( Name ) should begin with btn (btnComplete)  Text – text displayed on the button

Using the Button Control A Click event is usually coded for a Button object. The object.method (btnCalc.click) after the “Handles” is the connection to the form. This code will run when btnCalc is clicked during runtime. The same object.method(btnCalc.click) after the “Sub” does NOT matter and can be changed without affecting when this code runs.

To Create a Button Click 1. Double click the button – or – 2. Open the code editor window. 1. Select the button from the class name list 2. Select the Click from the method name list

The CheckBox Control Allows user to select options. Can select more than one option. Properties  Name – identifies the control – prefix is chk  Text – text displayed next to the box  Checked – True or False (will change to True when clicked and checkmark shows, changes to False when clicked and checkmark is removed). Can be set in properties window and also at runtime. Can be placed in a GroupBox (add GroupBox before adding Checkboxes)  Placing in a GroupBox ties the CheckBoxes together.

The GroupBox Control The GroupBox is in the Containers area of the Toolbox. Properties  (Name) should begin with grp (grpCookies)  Text – text displayed at the top of the box

The CheckBox Control

Checked Property A checkmark shows when the Chili.Checked property is set to TRUE. The Onion.Checked property by default is set to FALSE so no checkmark shows. During runtime, clicking on the checkboxes will both change the property and show the checkmark..

Using the CheckBox Control You can use a CheckBox in several ways.  Click Event  CheckChanged Event  Checked Property  We will use this in the decision unit(4.00) later to determine which checkbox was chosen. You can create a CheckBox Click event the same way you created the Button Click. To create a CheckChanged event, you will need to select the method from the code editor window.

The RadioButton Control A group of radio control buttons is often used in an application to enable the user to choose from a set of options. Only one radio button can be selected at any time. RadioButton control properties  (Name) Should begin with rad (radChocChip)  Text the text displayed next to the button  Checked set to either True or False to display the radio button as selected or not selected.

The RadioButton Control RadioButtons also use the GroupBox container. Put your GroupBox on the form first, then add the RadioButtons.  If you do not, the user will be able to select more than one radio button.  Add the RadioButton objects by clicking the RadioButton control, then clicking the group box.

The RadioButton Control

Using The RadioButton Control You can use a RadioButton in several ways.  Click Event  CheckChanged Event  Checked Property  We will learn more about this property later You can create a RadioButton Click event the same way you created the Button Click. To create a CheckChanged event, you will need to select the method from the code editor window.

Using Controls Examples Open a new Project called example. Add the following Controls  Button – btnHello  Label – lblMessage Create a button click event for your btnHello Add the code to display the message “Hello” in the lblMessage label lblMessage.Text = “Hello”  Note  Your string must be in the double quotation marks.  You must write the statement

Using Controls Examples Add a GroupBox – grpChoices Add the following RadioBoxes  radEnglish  radFrench  radGerman Add the following messages in Click events for each.  radEnglish_Click lblMessage.Text = “Hello”  radFrench_Click lblMessage.Text = “Bonjour”  radGerman_Click lblMessage.Text = “Guten Tag”

Using Controls Examples Change your RadioButtons to CheckBoxes. Use the same messages.

Additional Controls We will add additional controls during this course.