Controls in C++/CLI (2) CheckBox RadioButton GroupBox ListBox.

Slides:



Advertisements
Similar presentations
Microsoft Expression Web-Illustrated Unit J: Creating Forms.
Advertisements

Information System Design Lab 5&6. User Interface Design.
Programming with Microsoft Visual Basic 2008 Fourth Edition
Pemrograman VisualMinggu …8… Page 1 MINGGU Ke Delapan Pemrograman Visual Pokok Bahasan: Graphical User Interface Tujuan Instruksional Khusus: Mahasiswa.
Microsoft Visual C#.NET: From Problem Analysis to Program Design1 Chapter 9 Programming Based on Events Microsoft Visual C#.NET: From Problem Analysis.
C# Programming: From Problem Analysis to Program Design1 9 Programming Based on Events.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
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.
Programming Based on Events
ListBoxes The list box control allows the user to view and select from multiple items in a list. CheckedListBox control extends a list box by including.
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.
Programming Based on Events
List-based Controls. Slide 2 Introduction There are several controls that work with lists ComboBox ListBox CheckedListBox.
GUI-Labels, TextBoxes and Buttons Label- displays read-only text Label- displays read-only text Common properties: Common properties: Font – font used.
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.
Neal Stublen Tonight’s Agenda  More form controls  Multi-form projects  Application debugging  Object-oriented programming and.
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
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.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Six Repeating Program Instructions.
1 Graphical User Interfaces Part 2 Outline ListBoxes and CheckedListBoxes ListBoxes CheckedListBoxes ComboBoxes.
CSCI 3327 Visual Basic Chapter 10: Windows Forms GUI: A Deeper Look UTPA – Fall 2011.
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,
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
CIS 200 Test 02 Review. Windows Forms, GUI Programming  Elements  Textboxes  Tab Groups  Checkboxes  Fields  Event Handlers  Visual Studio Designer.
CIS 338: VB.NET Components Dr. Ralph D. Westfall April, 2011.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Six The Do Loop and List Boxes.
IS437: Spring 2006 Instructor: Dr. Boris Jukic Controls.
1 Chapter Ten Using Controls. 2 Objectives Learn about Controls How to create a Form containing Labels How to set a Label’s Font How to add Color to a.
Module 1 Window Forms – Basic, Grouping and Graphic controls 1.
WinForms – Basic Controls
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 18 – Student Grades Application Introducing.
Programming Interface Controls ISYS 350. User Interface Controls Form MessageBox Common Controls: –Button, TextBox, MaskedTextBox, List Box, Option Button,
Controls Part 2. DateTimePicker Control Used for representing Date/Time information and take it as input from user. Date information is automatically.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al- ajmi Chapter 3 Some Visual Basic Controls and Events Visual Basic. NET.
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.
Programming with Visual C++: Concepts and Projects Chapter 4B: Selection (Tutorial)
AdditionalControls 1. The MenuStrip 2 Double-click Let’s begin to design the menu bar for VB! Let’s begin to design the menu bar for VB! 3.
Iterations (aka Loops). 2 Loops Loops (iterations) are segments of code that may be executed several times. Fixed-count (definite) loops repeat a fixed.
Unit 6 Repetition Processing Instructor: Brent Presley.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Iterations (aka Loops). 2 Loops Loops (iterations) are segments of code (loop body) that may be executed several times. Fixed-count (definite) loops repeat.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Using Forms and Form Elements In Visual Basic.NET.
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.
Hamilton Software Products The Measure of Excellence Customized dialog.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
INF230 Basics in C# Programming
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Computing with C# and the .NET Framework
Programming Based on Events
C# Programming: From Problem Analysis to Program Design
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
Repeating Program Instructions
Custom dialog boxes Unit objectives
Programming Based on Events
Microsoft Visual Basic 2005: Reloaded Second Edition
المحاضرة الأولى Lab(1) أ.ساره الأحمدي برمجة حاسب 2.
CIS 16 Application Development Programming with Visual Basic
Fonts, TabControl, ListBox
Visual C# - GUI and controls - 1
– A principal I/O mechanism in Windows
Presentation transcript:

Controls in C++/CLI (2) CheckBox RadioButton GroupBox ListBox

Controls in C++/CLI (2) CheckBox (Property: Text, Checked, CheckState (checked/unchecked/indeterminate) ; Event: Clicked, CheckedChanged, CheckStateChanged) Multiple choices RadioButton (Property: Text, Checked; Event: Clicked, CheckedChanged) Single choice in one container

Example 1 Start from the last project TestCheck CheckBox Remove TextBox CheckBox Dialog Box: Add three CheckBoxes for CS415, CS425, CS435; Names to be cbCS415, cbCS425, cbCS435 Add variables for inputs, and constructor Handle Click events to get input Form1: Invoke dialog box Get/use data

Example 2 Start from the last project TestCheck RadioButton: Remove TextBox RadioButton: Dialog Box: Add four RadioButtons for Freshman, Sophomore, Junior, and Senior; Names to be rbFreshman, rbSophomore, rbJunior, and rbSenior Add variables for inputs, and constructor Handle Click events to get input Form1: Invoke dialog box Get/use data

Controls in C++/CLI (2) GroupBox Group RadioButtons, will allow multiple in a form -- each in one group

Example 3 GroupBox: Start from the Dialog example Dialog Box: Add two GroupBoxes for “years in school” and “study habits”; change the Text And Name accordingly, e.g, Names to be gbYears and gbStudy; Add RadioBottuns to each GroupBox: “years in school” to have Freshman, Sophomore, Junior, and Senior; and “study habits” to have night owl and early bird; change the Text And Name accordingly; Add variables for inputs, and constructor Handle Click events to get input Form1: Invoke dialog box; Get/use data (more data and displays)

Controls in C++/CLI (3) ListBox (Property: SelectionMode, Items, SelectedItem, SelectedIndex, SelectedItems, SelectedIndices; Event: SelectedIndexChanged) Show a collection of values, each with index, scrollable; Select one or more items, event SelectionMode (None, One, MultiSimple, and MultiExtended) please see http://msdn.microsoft.com/en-us/library/system.windows.forms.selectionmode.aspx

Items (ObjectCollection, add, remove, ) SelectedIndex (Int32, zero-based index) SelectedIndices (a collection of zero-based indices); SelectedItem (nullptr value if not actually selected), SelectedItems Event: SelectedIndexChanged

An Example (1) Draft a design…. Form1 and myDialog Classes Variables, methods Components, event handlers Collections

An Example (2) Start from Form1 Add Label, Text “Name:”, Name “label1” Add ListBox, Name “nameList”, SelectionMode “one”; Add three Buttons for “Add”, “Delete” and Edit”; Name bnAdd, bnDelete, bnEdit; add click event handlers, bnAdd_Click, bnDelete_Click, bnEdit_Click; Add a form for MyDialog Add Label, Text “Enter Name:”; Add TextBox, Name myTextBox; Add two buttons for “OK” and “Cancel”, Name as bnOK, bnCancel; add click events of bnOK_Click and bnCancel_Click; Write handler methods; set DialogResult for each; Set MyDialog’s AcceptButton and CancelButton;