Controls Part 2. DateTimePicker Control Used for representing Date/Time information and take it as input from user. Date information is automatically.

Slides:



Advertisements
Similar presentations
Information System Design Lab 5&6. User Interface Design.
Advertisements

Programming with Microsoft Visual Basic th Edition
Pemrograman VisualMinggu …8… Page 1 MINGGU Ke Delapan Pemrograman Visual Pokok Bahasan: Graphical User Interface Tujuan Instruksional Khusus: Mahasiswa.
Microsoft Visual Basic: Reloaded Chapter Seven More on the Repetition Structure.
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.
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
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.
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.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
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- Date TimePicker 2- Month Calendar 3- User Defined Controls.
1 Graphical User Interfaces Part 2 Outline ListBoxes and CheckedListBoxes ListBoxes CheckedListBoxes ComboBoxes.
1 Web-Enabled Decision Support Systems Windows Forms and Controls Prof. Name Position (123) University Name.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
CIS 338: VB.NET Components Dr. Ralph D. Westfall April, 2011.
Controls in C++/CLI (2) CheckBox RadioButton GroupBox ListBox.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Six The Do Loop and List Boxes.
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 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.
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.
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
Module 1 Window Forms – Basic, Grouping and Graphic controls 1.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 18 – Student Grades Application Introducing.
Module 3 Designing and Developing a User Interface.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
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.
Programming with Visual C++: Concepts and Projects Chapter 4B: Selection (Tutorial)
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
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.
 A ListBox control displays a list of items and allows the user to select one or more  Drag from Toolbox to create this control on a form.
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.
1 4.2 Selection Logical Operators. 2 Learning Objectives Explain how the logical operator AND Boolean statements works. Directly testing if text boxes.
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”
Controls in C++/CLI (2) CheckBox RadioButton GroupBox and Panel.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
CSCI 6962: Server-side Desig n and Programming ASP Server Controls.
14 Shipping Time App Using Dates and Timers
Tutorial 14 – Shipping Time Application Using DateTimes and Timers
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Computing with C# and the .NET Framework
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
VISUAL BASIC FINAL EXAM REVIEW SHEET
مراحل كتابة البرنامج بلغة فيجول بيسك ستديو
Programming Based on Events
CIS 16 Application Development Programming with Visual Basic
Lecture Set 10 Windows Controls and Forms
2g – ComboBox Lingma Acheson CSCI N331 VB .NET Programming
Visual C# - GUI and controls - 1
Group Boxes, Radio buttons and Checked List Boxes
CHAPTER FOUR VARIABLES AND CONSTANTS
Presentation transcript:

Controls Part 2

DateTimePicker Control Used for representing Date/Time information and take it as input from user. Date information is automatically created. Prevents wrong date and time input.

Fundamental Properties of DateTimePicker Format CustomFormat Colors… MaxDate MinDate Value Location Size

DateTimePicker Control Date and time information that is stored in DateTimePicker resides in Value property which is DateTime type. To set Value property first we should create a new DateTime object; public DateTime( int year, int month, int day );int public DateTime( int year, int month, int day, int hour, int minute, int second );int

DateTimePicker Control To return value as string; We use DateTimePicker.Value.ToString(string format) function. Possible format input types Year : ‘y’ Month : ‘M’ Day : ‘d’ Hour : ‘h’ Minute : ‘m’ Second : ‘s’

Exercise Previously we created a form which takes user’s name and surname. Now add a DateTimePicker control to the form. Then show user’s birth date in the MessageBox.

Timer Control Timer control is used for performing some tasks periodically. Time period can be set during development or runtime.

Timer Properties Enabled Interval Note : Timer can not be seen on the form. It runs at background and performs it’s action when determined time is passed.

Exercise Add time property to our program. To accomplish this add a Timer control named timerClock to Form. Then set Interval property to 1000 msec = 1sec and Enabled property to true. Add a Label to form and set it’s name to lblHour. Open Events view and create Tick Event Handler for Timer.

Exercise Add the code to timerClock_Tick function that will write current to lblHour. Note: To obtain current time you may use DateTime.Now.Tostring() function.

GroupBox Used for grouping a bunch of elements that are logically related with each other. Creates sub-sets of elements on the form depending on their functionalities. Relations between of some the controls (e.g. RadioButtons) are automatically assigned when they reside in the same group.

Fundamental Properties of GroupBox BackColor ForeColor Text Enabled Visible Name

RadioButton Control Enables user to select a single option from a group of choices. Only one RadioButton can be in selected state within a form or GroupBox.

Fundamental Properties of RadioButton BackColor CheckAlign Checked ForeColor Text Enabled Visible

Fundamental Events of RadioButton Click CheckedChanged

Exercise Add a functionality to the form that asks user about his/her gender. In this task create a GroupBox named grpGender and set its Text property to “Gender”. Add two RadioButtons (rbMale and rbFemale) to the GroupBox and set appropriate texts to the radio buttons. Change Checked property of one of the RadioButton to true.

Exercise Show the gender of the user in the MessageBox by using the choice seen in RadioButtons

CheckBox Control It is similar to the RadioButton but all CheckBoxes can be selected in a CheckBox group. In other words, CheckBoxes are used when user can select multiple options between multiple choices.

Fundamental Properties of CheckBox BackColor CheckAlign Checked CheckState ForeColor Text Enabled Visible

Fundamental Events of CheckBox Click CheckedChanged

Exercise Create a GroupBox named grpLectures and place at least four CheckBoxes that holds lecture names. Depending of the check state of these CheckBoxes write the lectures to the MessageBox which are selected by user.

Exercise

ListBox Control Allows user to select one or multiple options between a listed collection of choices.

Fundamental Properties of ListBox SelectionMode Sorted Items SelectedIndex SelectedItem Note : To add items to a ListBox; You should call Items.Add() function during run-time or Add lines to the window which is opened when Items element is clicked in Properties during design time.

Fundamental Events of ListBox DoubleClick SelectedIndexChanged

Exercise Add a ListBox named lbDepartment to the Form. And add a couple of departments the the window which is opened when Items property is clicked.

Exercise Show the department that is selected in the MessageBox.

ComboBox Control Enables user to select only one option between a listed collection. During selection all items in the collection are displayed but, after selection only selected item is displayed.

Fundamental Properties of ComboBox DropDownWidth MaxDropDownItems Sorted Items SelectedIndex SelectedItem.

Fundamental Events of ComboBox SelectedIndexChanged

Exercise Convert ListBox control that we have added to the Form to a ComboBox control.

Exercise Write a program that calculates the bills in a restaurant. Program first should ask table number and customer name. Then dishes should be selected from menu and added to the bill. Finally account of invoice is calculated after processing discounts.

Exercise