WinForms – Basic Controls

Slides:



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

CSCI 3328 Object Oriented Programming in C# Chapter 10: Graphical User Interfaces with Windows Forms 1 Xiang Lian The University of Texas – Pan American.
Pemrograman VisualMinggu …8… Page 1 MINGGU Ke Delapan Pemrograman Visual Pokok Bahasan: Graphical User Interface Tujuan Instruksional Khusus: Mahasiswa.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
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.
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.
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.
1 Pertemuan 02 Visual Basic Environment and Control Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
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.
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
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,
CIS 115 Lecture 3.  Forms  Form properties  Controls  Control properties  Event Driven Programming  Form Events  Control Events  Event Handlers.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Week 2: WINDOWS PROGRAMMING Chapter 15 in “Beginning Visual C# 2010” ebook Chapter 4 in “”MCTS_Self-Paced_Training_Kit” ebook.
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.
Some Interesting Controls. Controls We've UsedNew Controls LabelListBox TextBoxCheckedListBox ComboBoxTabControl ButtonTabPage Menu MenuItem TreeView.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 – Graphical User Interfaces Part 2 Outline.
Graphical User Interface Concepts - Part 2 Session 09 Mata kuliah: M0874 – Programming II Tahun: 2010.
© 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.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
Visual Basic.NET BASICS Lesson 3 Events and Code.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
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.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383
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.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
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.
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.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
1 Windows Forms II Chapter RadioButton / GroupBox Controls Used to solicit a multiple choice input. Radio buttons work as a group. Selecting one.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Controls in C++/CLI (2) CheckBox RadioButton GroupBox and Panel.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
Graphical User Interface Concepts - Part 1 Session 08 Mata kuliah: M0874 – Programming II Tahun: 2010.
Graphical User Interface
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.
3.01 Apply Controls Associated With Visual Studio Form
Week 3: WINDOWS PROGRAMMING
3.01 Apply Controls Associated With Visual Studio Form
Visual programming Chapter 3: GUI (Graphical User Interface) Part I
مراحل كتابة البرنامج بلغة فيجول بيسك ستديو
المحاضرة الأولى Lab(1) أ.ساره الأحمدي برمجة حاسب 2.
The University of Texas – Pan American
Windows Controls Child Window Controls
Window Form Trần Anh Tuấn.
Visual programming Chapter 4: GUI (Graphical User Interface) Part II
Lecture Set 10 Windows Controls and Forms
Module 05: Building ASP .NET Applications
Visual C# - GUI and controls - 1
CIS 338: Images on Forms Dr. Ralph D. Westfall May, 2009.
3.Visual Basic Controls.
Week 2: WINDOWS PROGRAMMING
Presentation transcript:

WinForms – Basic Controls

Objectives Overview Window Form and basic Control Form class Type of Control Basic Control Summary

Windows Form

WinForms and .NET Framework

Features Create App with leats operation Store global data to reused anywhere ToolStrip,MenuStrip …. Powerfull way to link control with data source ( BindingSource component) GDI+ : drawing and painting image on forms

Form : basic unit of Application

Form : property & method

Events

Life cycle of a form Event Click Deactivated FormClosed FormClosing GotFocus Load Resize

Base class of all controls available in WinForms Use of Controls Control class Base class of all controls available in WinForms

Control Class – Properties-Method Event Click ControlAdd DoubleClick Validating Validated KeyPress Leave LostFocus MouseClick Move canFocus Controls Enable Name Parent TabIndex Visible Focus getNextControl Hide IsMNemonic Select Show

Common Controls

Label class : Property – Method- Event Properties Method Event Click Name Text TextAlign UseMnemonic Contains Hide Show Label fname = new Label(); fname.Text = “&First Name : “; fname.UseMnemonic = true ;

TextBox & MaskedTextBox

TextBox class : Property – Method- Event Properties Method Event KeyPress Leave TextChanged CharacterCasing MaxLength MultiLine Name PasswordChar ReadOnly Text AppendText Clear Focus Copy Paste

MaskedTextBox class : Property – Method- Event Properties Method Event MaskChanged MaskedInputRejected Mask MaskFull MaskCompleted Name PromptChar Text GetPositionFromCharIndex IsKeyLock SelectAll MaskedTextBox mks = new MaskedTextBox(); mks.Mask = “00000-9999”; mks.Text = “095204-7763”; if(!mks.MaskFull) { MessageBox.Show(“Enter proper code …”); }

Mask

Button class : Property – Method- Event Properties Method Event Click DoubleClick MouseDoubleClick DialogResult Enabled FlatStyle Image Name Text Focus PerformClick Button cmdOK = new Button(); cmdOK .Text = “OK” ; cmdOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;

ListBox & ComboBox ListBox : select multivalue ( 1..N) ComboBox : select one value at a time

ListBox class : Property – Method- Event Properties Method Event DisplayMember Items SelectionMode SelectedIndex SelectedIndexChanged SelectedValueChanged ValueMemberChanged ClearSelected GetItemText GetSelected SetSelected

ComboBox class : Property – Method- Event Properties Method Event DropDown SelectedIndexChanged SelectedValueChanged ValueMemberChanged DropDownStyle Items MaxDropDownItem SelectedItem SelectedIndex Text ValueMember GetItemText SelectAll Select ( int start , int length)

Display a Hyperlink that link to a Web Page or another Window Form LinkLabel Control Display a Hyperlink that link to a Web Page or another Window Form Properties : ActiveLinkColor , Links , LinkColor , LinkVisited, Text , VisitedLinkColor Method : Select Event : LinkClicked

Summary – WorkShop Activities What is WinForm ? Focus on Control TextBox , ListBox , ComBoBox ….

Grouping Controls Value Setting ControlForm class RadioButton CheckBox CheckListBox Grouping Controls GroupBox Panel Images Control PictureBox ImageList Summary

RadioButton Class – Properties-Method Event Appearance AutoCheck Checked Image PerformClick Select Show CheckedChanged Click

CheckBox class : Property – Method- Event Properties Method Event Checked CheckState ThreeState CheckedChanged CheckStateChange Click Select Show

CheckedListBox class : Property – Method- Event Properties Method Event CheckedIndices CheckedItems CheckOnClick Items SelectedValue SelectedItems SelectedItem ClearSelected GetItemChecked GetItemCheckState GetItemText SetItemChecked SetItemCheckState ItemCheck MouseClick SelectedIndexChanged SelectedValueChanged

Grouping Control Panel Contains other Control GroupBox As Panel but appear as Frame around Control

Panel class : Property – Method- Event Properties Method Event AutoSize AutoSizeMode BorderStyle StyleChanged VisibleChanged Select Show

GroupBox : Property – Method- Event Properties Method Event AutoSize Anchor FlatStyle StyleChanged Resize Hide Show

Graphic Controls PictureBox Display image on the Form ( .bmp ,.jpg ..) Can hold sigle image at a time ImageList Store collection of images

PictureBox : Property – Method- Event Properties Method Event Image ErrorImage InitialImage SizeMode Click Leave LoadCompleted Load LoadAsync

ImageList: Property – Method- Event Properties Method Event Images ColorDepth ImageSize Name RecreateHandle Draw

SplitContainer Divide the form into two resizable panels Properties BorderStyle FixedPanel IsSplitterFixed Panel1 Panel2 Orientation Method OnSplitterMoved OnSplitterMoving Divide the form into two resizable panels As Window Explorer Event SplitterMoved SplitterMoving Click

Summary – WorkShop Activities