Module 1 Window Forms – Basic, Grouping and Graphic controls 1.

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.
Microsoft Visual Basic: Reloaded Chapter Seven More on the Repetition Structure.
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.
C# Programming: From Problem Analysis to Program Design1 9 Programming Based on Events.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
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.
List-based Controls. Slide 2 Introduction There are several controls that work with lists ComboBox ListBox CheckedListBox.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab2 Managing Controls.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
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.
IE 411/511: Visual Programming for Industrial Applications
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.
ASP.NET Web Server Controls Basic Web Server Controls.
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.
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.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
© 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.
Introduction 1. CIS 400 Programming for the Windows Environment 2.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
C# GUI - Basics. Objectives.NET supports two types: WinForms, traditional, desktop GUI apps. WebForms – newer, for Web apps. Visual Studio.NET supports.
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.
More Controls and Their Properties Part 4 dbg --- TextBox, CheckBox, RadioButton, GroupBox, ToolTips,
CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383
WinForms – Basic Controls
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 2 User Interface Design.
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.
Chapter 2 More Controls Programming in C#. NET Objectives Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively.
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.
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
Object Orientated Programming using C#
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
3.01 Apply Controls Associated With Visual Studio Form
Visual programming Chapter 3: GUI (Graphical User Interface) Part I
The University of Texas – Pan American
Windows Controls Child Window Controls
Window Form Trần Anh Tuấn.
Visual C# - GUI and controls - 1
3.Visual Basic Controls.
Week 2: WINDOWS PROGRAMMING
Presentation transcript:

Module 1 Window Forms – Basic, Grouping and Graphic controls 1

Objective  Overview Window Form and basic Control  Form class  Types of Control  Basic Controls  Grouping an Graphic Controls 2

Application 3 User Interface - Easy to learn - Easy to use - Attractive Program

WinForms and.NET Framework Windows Forms :  are a part of the.NET Framework that is used to build, deploy and run applications.  Provide with a standard programing model in order to create application with least bugs.  Are executed in the.NET CLR runtime. 4

Features Click one deployment Application setting New Windows Forms controls New Data Binding model Rich graphics 5 Create App with least operation Store global data to reuse anywhere Powerfull way to link control with data source ( BindingSource component ) GDI+ : drawing and painting image on forms ToolStrip, MenuStrip ….

Form Is the basic unit of an application Presents information to the user Receives information from the user. Is represented as a class in the System.Windows.Forms namespace. 6 Properties Text, BackColor, ForeColor, Font, WindowState, AcceptButton, Location, Modal, Name MethodsActivate, Close, Focus, Hide, Show, Enabled EventsLoad, Activated,Shown,Deactivate, FormClosing, FormClosed, Resize, Click, GotFocus

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

Control Class CanFocus Controls Enable Name Parent TabIndex Visible 8 Properties  Focus  GetNextControl  Hide  IsMNemonic  Select  Show Method  Click  ControlAdd  DoubleClick  Validating  Validated  KeyPress  Leave  LostFocus  MouseClick  Move Event Example this.[controlname].[propertyname]

Common Controls Label Textbox Button ListBox ComboBox LinkLabel 9

Label Name Text TextAlign UseMnemonic 10 Properties  Contains  Hide  Show Method  Click Event Label fName = new Label(); fname.Text = “&First Name : “; fName.UseMnemonic = true ; Label

TextBox CharacterCasing MaxLength MultiLine Name PasswordChar ReadOnly Text 11  AppendText  Clear  Focus  Copy  Paste  KeyPress  Leave  TextChanged TextBox PropertiesMethodEvent

MaskedTextBox Mask MaskFull MaskCompleted Name PromptChar Text 12  GetPositionFrom CharIndex  SelectAll  MaskChanged  MaskedInputRejected MaskedTextBox mks = new MaskedTextBox(); mks.Mask = “ ”; mks.Text = “ ”; if(!mks.MaskFull) { MessageBox.Show(“Enter proper code …”); } PropertiesMethodEvent

Mask Description 0Digit, required. [0-9] 9Digit or space, optional. # Digit or space, optional. If this position is blank in the mask, it will be rendered as a space in the property. Plus (+) and minus (-) are allowed. LLetter, required [a-zA-Z]. ?Letter, optional. [a-zA-Z]. &Character, required. If the property = true, behaves like the "L". C Character, optional. Any non-control character. If the property =true, this element behaves like the "?" element. A Alphanumeric, optional. If the property =true, the only characters it will accept are the ASCII letters a-z and A-Z. a Alphanumeric, optional. If the property is set to true, the only characters it will accept are the ASCII letters a-z and A-Z. 13

Button DialogResult Enabled FlatStyle Image Name Text 14 Button cmdOK = new Button(); cmdOK.Text = “OK” ; cmdOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat; PropertiesMethodEvent Focus PerformClick Click DoubleClick MouseDoubleClick Button

ListBox Can select multivalues 15 DisplayMember Items SelectionMode SelectedIndex ClearSelected GetItemText GetSelected SetSelected SelectedIndexChanged SelectedValueChanged ValueMemberChanged PropertiesMethodEvent

ComboBox DropDownStyle Items MaxDropDownItem SelectedItem SelectedIndex Text ValueMember 16  GetItemText  SelectAll  Select (int start, int len)  DropDown  SelectedIndexChanged  SelectedValueChanged  ValueMemberChanged PropertiesMethodEvent

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

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

RadioButton Appearance AutoCheck Checked Image 19  PerformClick  Select  Show  CheckedChanged  Click PropertiesMethodEvent

CheckBox Checked CheckState ThreeState 20  Select  Show  CheckedChanged  CheckStateChange  Click PropertiesMethodEvent

CheckedListBox CheckedIndices CheckedItems CheckOnClick Items SelectedValue SelectedItems SelectedItem 21  ClearSelected  GetItemChecked  GetItemCheckState  GetItemText  SetItemChecked  SetItemCheckState  ItemCheck  MouseClick  SelectedIndexChanged  SelectedValueChanged PropertiesMethodEvent

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

Panel AutoSize AutoSizeMode BorderStyle 23  Select  Show  StyleChanged  VisibleChanged PropertiesMethodEvent

GroupBox AutoSize, Anchor, FlatStyle 24 Hide, Show StyleChanged, Resize Properties Method Event

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

PictureBox Image ErrorImage InitialImage SizeMode 26  Load  LoadAsync  Click  Leave  LoadCompleted PropertiesMethodEvent

ImageList Images ColorDepth ImageSize Name 27  Draw  RecreateHandle PropertiesMethodEvent

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