GUI-Labels, TextBoxes and Buttons Label- displays read-only text Common properties:  Font – font used by the text of label  Text – text to appear on.

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Select Case Statements and Selection Input.
Advertisements

Pemrograman VisualMinggu …8… Page 1 MINGGU Ke Delapan Pemrograman Visual Pokok Bahasan: Graphical User Interface Tujuan Instruksional Khusus: Mahasiswa.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 7: Chapter 4: Slide 1 Unit 7 Decisions (Cont.) and Message Boxes Chapter.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Chapter 12- GUI Concepts I. 12.1Introduction 12.2 Windows Forms 12.3 Event-Handling Model Basic Event Handling 12.4 Control Properties and Layout.
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
Graphical User Interface (GUI) A GUI allows user to interact with a program visually. GUIs are built from GUI components. A GUI component is an object.
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.
GUI-Labels, TextBoxes and Buttons Label- displays read-only text Label- displays read-only text Common properties: Common properties: Font – font used.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
 2006 Pearson Education, Inc. All rights reserved Graphical User Interface Concepts: Part I.
110-C1 Chapter 2 of the text: _ text boxes, group boxes, check boxes, radio buttons, picture boxes _ defining access keys tab sequence setting the focus.
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Chapter 7 Decision Making. Class 7: Decision Making Use the Boolean data type in decision-making statements Use If statements and Select Case statements.
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Chapter 2 More Controls Programming in C#. NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 13 Creating User.
Programming Interface Controls ISYS 350. User Interface Controls Form MessageBox Common Controls: –Button, TextBox, MaskedTextBox, List Box, Option Button,
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 8 Dental Payment Application Introducing CheckBox es and Message Dialogs.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 12 - Graphical User Interface Concepts: Part.
Controls in C++/CLI (2) CheckBox RadioButton GroupBox ListBox.
Visual C# 2012 How to Program 1. 2  A graphical user interface (GUI) allows a user to interact visually with a program.  Figure 14.1 shows a Visual.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
Intro to More Controls in C#. C# Demonstration We already touched on labels and buttons Ad-hoc demo of controls – Textboxes Multiline – Checkbox – Radiobutton.
1. S:\Courses\CSSE\ibrahima\CS2340\Notes Folder Section1 Folder Section2 2.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Decisions and Debugging Part06dbg --- if/else, switch, validating data, and enhanced MessageBoxes.
BIM211 – Visual Programming Interacting with Users Graphics 1.
G RAPHICAL U SER I NTERFACE C ONCEPTS : P ART 2 1 Outline Control Properties and Layout Label s, TextBox es and Button s GroupBox es and Panel s CheckBox.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Controls. Adding Controls to Form -You can pick controls from the toolbox. -To add the controls from Toolbox to the Form You have be in design view. -To.
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 C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
More Controls and Their Properties Part 4 dbg --- TextBox, CheckBox, RadioButton, GroupBox, ToolTips,
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface Creating a Multiple-Form Interface.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
Programming Interface Controls ISYS 350. User Interface Controls Form MessageBox Common Controls: –Button, TextBox, MaskedTextBox, List Box, Option Button,
Chapter 11 - A GUI Interacting With a Problem Domain Class1 Chapter 11 A GUI Interacting With a Problem Domain Class 11.
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.
Chapter 2 More Controls Programming in C#. NET Objectives Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively.
Word Processor Version.01 EME 4411 Week 5. The Scroll Bars.
Graphical User Interface Components Version 1.1. Obectives Students should understand how to use these basic Form components to create a Graphical User.
1 Windows Forms II Chapter RadioButton / GroupBox Controls Used to solicit a multiple choice input. Radio buttons work as a group. Selecting one.
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”
Controls in C++/CLI (2) CheckBox RadioButton GroupBox and Panel.
 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.
Graphical User Interface Concepts - Part 1 Session 08 Mata kuliah: M0874 – Programming II Tahun: 2010.
(PART II) Graphics and Multimedia. Font Control Font s  After a Font is created, its properties cannot be modified  Programmers must create a new Font.
 2007 Pearson Education, Inc. All rights reserved Graphical User Interface Concepts: Part 1.
Computing with C# and the .NET Framework
Graphical User Interface Concepts: Part I
IS 350 Decision-making.
Visual programming Chapter 3: GUI (Graphical User Interface) Part I
Chapter#9: A Deeper Look In Controls
Module 2 إنشاء تطبيقات الويندوز
Part A – Doing Your Own Input Validation with Simple VB Tools
Graphical User Interface Concepts: Part I
Visual C# - GUI and controls - 1
Chapter 4 Decisions and Conditions
Presentation transcript:

GUI-Labels, TextBoxes and Buttons Label- displays read-only text Common properties:  Font – font used by the text of label  Text – text to appear on the label  TextAlign – Alignment of the label’s text Button – user click to trigger a specific action Common properties  Text Common event  click

GUI- TextBoxes Common properties  AcceptsReturn: If true, pressing Enter creates a new line in the text box, if that text box spans multiple lines. If false, press enter clicks the default button of the form  Multiline: if true, text box can span multiple line  PasswordChar:single character to display instead of typed text.  ReadOnly: if true, text box has grey background and its text cannot be edited  ScrollBars: for multiple lines text, indicated which scrollbars appear  Text : text to be displayed in the text box Common event  TextChanged

GUI-CheckBoxes Checkbox:  A group of check boxes allow the user to select combinations of choices.  Any number may be selected at a time  The text that appear alongside a check box is referred to as the checkbox label. Properties  Checked  CheckState Events  CheckedChanged  CheckStateChanged

GUI-RadioButton RadioButton:  Several radio buttons group together  Only one of the radio buttons in the group can be selected (true) at any time Properties:  Checked : specifies whether the radio button is checked  Text: Text displayed to the right of the radio button Events:  Click: Raised when user click the control  CheckedChanged: Raised every time the radio button is checked or unchecked

Font property To change the font, the Font property must be set to a Font object The Font constructor takes the font name, size and style  FontStyle enumeration contains Regular Bold Italic Strikeout Underline

Style property A Font object’s Style property is set when the Font object is created – the Style property itself is read-only Styles can be combined using bitwise operators, or operators that perform manipulation on bits. Use bitwise XOR operator, we can set the font style so that the text will appear bold if it was not bold originally, and vice versa.

Bitwise XOR operator ^ Bitwise operator perform manipulation on bits. Actions are taken and data are modified using these bits values Bitwise XOR operator ^     If style is not bold(0), then set to bold(1) If style is already bold(1), then set to not bold(0)

Set the font style for a label Lb_message->Font = new Drawing::Font( lb_message->Font->name, lb_message- >Font->size, static_cast (lb_message- >Font->Style^FontStyle::Bold) );

MessageBox MessageBox::Show() can take three argument, and return DialogResult  String  MessageBoxButtons OK OKCancel YesNo YesNoCancel AbortRetryIgnore  MessageBoxIcon Error Exclamation Information Question

DialogResult DialogResult from MessageBox Contain enumeration value DialogResult::OK DialogResult::Cancel DialogResult::Abort DialogResult::Retry DialogResult::Ignore DialogResult::Yes DialogResult::No

Object passed to event handler Private: System::Void radio_MouseEnter( Object * sender, EventArg * e) { if ( sender == radioButton1) { // action } if ( sender == radioButton2) { // action } } Register one event handler to more object

Example code Private: System::Void buttonType_CheckedChanged( System::Object * sender, Ssytem::Eventarg *e) { if (sender == okButton) buttonType = MessageBoxButtons::OK; }