Chapter 12: Using Controls

Similar documents
Chapter 12: Using Controls

Dive Into Visual C# 2010 Express

Programming. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies

Introductionto the Visual Basic Express 2008 IDE

DateTimePicker Control

Interface Design in C#

Philadelphia University Faculty of Information Technology. Visual Programming

Using Visual Basic Studio 2008

Programming in C# Project 1:

Microsoft Visual C# 2005: Developing Applications Table of Contents

Tutorial 3 - Welcome Application

EEE-425 Programming Languages (2013) 1

EEE-425 Programming Languages (2013) 1

UNIT 3 ADDITIONAL CONTROLS AND MENUS OF WINDOWS

Lecture 1 Introduction Phil Smith

CST242 Windows Forms with C# Page 1

Full file at

Controls. By the end of this chapter, student will be able to:

Dive Into Visual C# 2008 Express

Introduction to the Visual Studio.NET Integrated Development Environment IDE. CSC 211 Intermediate Programming

1. What is the definition of a problem? 2. How to solve problems? 3. What is meant by Algorithm? 4. What is a Program testing? 5. What is Flowchart?

Overview Describe the structure of a Windows Forms application Introduce deployment over networks

Unit 3 Additional controls and Menus of Windows

Form Designer User Guide DOC-FD-UG-US-01/11/13

Computer Science 110. NOTES: module 8

Unit-1. Components of.net Framework. 1. Introduction to.net Framework

Introduction to the Visual Basic Express 2005IDE

Advanced Layout Tools

Quick Start guide. for windows and mac. creative learning tools. Kar2ouche Quick Start Guide Page 1

Keeping Track, Menus. CSC 330 Object-Oriented Programming 1

Full file at Programming in Visual Basic 2010

List and Value Controls

Microsoft Visio Working with Connectors

Advanced Layout Tools

Creating an MFC Project in Visual Studio 2012

Programming Training. This Week: Tkinter for GUI Interfaces. Some examples

While editing a page, a menu bar will appear at the top with the following options:

2 USING VB.NET TO CREATE A FIRST SOLUTION

Instructions for Formatting MLA Style Papers in Microsoft Word 2010

Setup Examples. RTPView Project Program

Unit 3. Lesson Designing User Interface-2. TreeView Control. TreeView Contol

Chapter 2 Visual Basic Interface

Text box. Command button. 1. Click the tool for the control you choose to draw in this case, the text box.

Philadelphia University Faculty of Information Technology. Visual Programming. Using C# -Work Sheets-

ListBox. Class ListBoxTest. Allows users to add and remove items from ListBox Uses event handlers to add to, remove from, and clear list

Deitel Series Page How To Program Series

Chapters and Appendix F are PDF documents posted online at the book s Companion Website (located at

Introduction to Microsoft Word

LESSON B. The Toolbox Window

You will have mastered the material in this chapter when you can:

Lecture 5 COMMON CONTROLS

Layout and display. STILOG IST, all rights reserved

Microsoft Access 2010

Overview of Adobe Fireworks CS6

Dell Canvas Layout. Version 1.0 User s Guide

Chapter 3. Fundamentals of Programming in Visual Basic

Using Excel 2011 at Kennesaw State University

Visual C# Program: Simple Game 3

Index. AutoNumber data types, 154 6, 168 and Number data type, 181 AutoPostBack Property, 505, 511, 513 5, 527 8, AVG, 242, 247 8

1. Windows Forms 2. Event-Handling Model 3. Basic Event Handling 4. Control Properties and Layout 5. Labels, TextBoxes and Buttons 6.

Microsoft Visual Basic 2005 CHAPTER 6. Loop Structures

Create and edit word processing. Pages.

MockupScreens - User Guide

B.V Patel Institute of Business Management, Computer & Information Technology

CHAPTER 3. Writing Windows C# Programs. Objects in C#

Chapters are PDF documents posted online at the book s Companion Website (located at

Maximizer. The CRM Company. User's Guide

B.V Patel Institute of BMC & IT, UTU

C# 2008 and.net Programming for Electronic Engineers - Elektor - ISBN

You can link completely different files into one by adopting a file to one or more of your topics.

November Copyright 2016 Open Systems Holdings Corp. All rights reserved.

USING THE CONSOLE TAB

Access 2003 Introduction to Report Design

OCTAVO An Object Oriented GUI Framework

ClipArt and Image Files

CSV Roll Documentation

Working with Excel involves two basic tasks: building a spreadsheet and then manipulating the

LESSON A. The Splash Screen Application

ALES Wordpress Editor documentation ALES Research websites

Working with Excel CHAPTER 1

Emma Marketing Training Manual

Road Traffic Collisions Tableau Dashboard Answering Key Questions General

P3e REPORT WRITER CREATING A BLANK REPORT

C# Continued. Learning Objectives:

Overview of Adobe Fireworks

Address Bar. Application. The space provided on a web browser that shows the addresses of websites.

Introduction to Business Statistics

ASIC-200 Version 5.0. integrated industrial control software. HMI Guide

Quick start guide CLIP PROJECT marking Part 2: Templates

XD++ Professional Edition -- it is designed for building professional flow diagramming applications only.

C# Windows Forms Applicaton Tutorial with Example

Week 5 Creating a Calendar. About Tables. Making a Calendar From a Table Template. Week 5 Word 2010

Index. B base classes creating, , 389 inheriting, inheriting in new classes, 390

Stamina Software Pty Ltd. TRAINING MANUAL Viságe BIT VIEWER

TABLE OF CONTENTS TABLE OF CONTENTS... 1 INTRODUCTION... 2 USING WORD S MENUS... 3 USING WORD S TOOLBARS... 5 TASK PANE... 9

Microsoft Office Word 2016 for Mac

INFORMATICS LABORATORY WORK #4

Welcome Application. Introducing the Visual Studio.NET IDE. Objectives. Outline

Installation 3. PerTrac Reporting Studio Overview 4. The Report Design Window Overview 8. Designing the Report (an example) 13

Getting started 7. Setting properties 23

Transcription:

Chapter 12: Using Controls

Examining the IDE s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton A Label has been dragged onto Form1 and its properties updated A Button has been dragged onto Form1 and its properties updated 2

Examining the IDE s Automatically Generated Code (cont d.) 3

Examining the IDE s Automatically Generated Code (cont d.) Within the Form1.Designer.cs file in Visual Studio, two lines of code are generated as follows: private System.Windows.Forms.Label label1; private System.Windows.Forms.Button okbutton; These lines appear under a gray box that contains Windows Form Designer generated code Expand the code generated by clicking the + in the method node or double-clicking the gray box 4

Examining the IDE s Automatically Generated Code (cont d.) 5

Setting a Control s Font Use the Font class to change the appearance of printed text on your Forms Change the appearance of printed text using code Create your own instance of the Font class The class includes a number of overloaded constructors Example: System.Drawing.Font bigfont = new System.Drawing.Font("Courier New", 16.5f); this.label1.font = bigfont; this.okbutton.font = bigfont; 6

Setting a Control s Font (cont d.) 7

Setting a Control s Font (cont d.) 8

Setting a Control s Font (cont d.) 9

Using a LinkLabel LinkLabel Similar to a Label Provides the additional capability to link the user to other sources Such as Web pages or files Default event The method whose shell is automatically created when you double-click the Control The method you are most likely to alter with Control The event that users most likely expect to generate 10

Using a LinkLabel (cont d.) 11

Using a LinkLabel (cont d.) LinkLabel appears as underlined text The text is blue by default When you pass the mouse pointer over a LinkLabel, the pointer changes to a hand When a user clicks a LinkLabel, it generates a click event Executing a LinkClicked() method The LinkVisited property can be set to true when you determine that a user has clicked a link 12

Using a LinkLabel (cont d.) 13

Using a LinkLabel (cont d.) 14

Using a LinkLabel (cont d.) 15

Adding Color to a Form Color class Contains a wide variety of predefined Colors that you can use with your Controls You can change a Form s color using its BackColor and ForeColor properties 16

Using CheckBox and RadioButton CheckBox objects Objects GUI widgets the user can click to select or deselect an option RadioButtons Similar to CheckBoxes Only one RadioButton in a group can be selected at a time 17

Using CheckBox and RadioButton Objects (cont d.) 18

Using CheckBox and RadioButton Objects (cont d.) 19

Using CheckBox and RadioButton Objects (cont d.) 20

Using CheckBox and RadioButton Objects (cont d.) 21

Using CheckBox and RadioButton Objects (cont d.) 22

Adding a PictureBox to a Form PictureBox A Control in which you can display graphics from a bitmap, icon, JPEG, GIF, or other image file type 23

24

Adding a PictureBox to a Form (cont d.) 25

Adding a PictureBox to a Form (cont d.) 26

Adding ListBox, CheckedListBox, and ComboBox Controls to a Form ListBox, ComboBox, and CheckedListBox objects List-type widgets that descend from ListControl ListBox Control Displays a list of items the user can select by clicking Allows the user to make a single selection or multiple selections by setting the SelectionMode property SelectedItem property Contains the value of the item a user has selected 27

Adding ListBox, CheckedListBox, and ComboBox Controls to a Form (cont d.) 28

Adding ListBox, CheckedListBox, and ComboBox Controls to a Form (cont d.) 29

Adding ListBox, CheckedListBox, and ComboBox Controls to a Form (cont d.) 30

Adding ListBox, CheckedListBox, and ComboBox Controls to a Form (cont d.) 31

Adding ListBox, CheckedListBox, and ComboBox Controls to a Form (cont d.) 32

Adding ListBox, CheckedListBox, and ComboBox Controls to a Form (cont d.) ComboBox Control Similar to a ListBox Displays an additional editing field Allows the user to select from the list or to enter new text CheckedListBox Control Similar to a ListBox Check boxes appear to the left of each desired item 33

Adding ListBox, CheckedListBox, and ComboBox Controls to a Form (cont d.) 34

Adding MonthCalendar and DateTimePicker Controls to a Form MonthCalendar and DateTimePicker Controls Allow you to retrieve date and time information 35

Adding MonthCalendar and DateTimePicker Controls to a Form (cont d.) 36

Adding MonthCalendar and DateTimePicker Controls to a Form (cont d.) 37

Adding MonthCalendar and DateTimePicker Controls to a Form (cont d.) 38

Adding MonthCalendar and DateTimePicker Controls to a Form (cont d.) 39

Adding MonthCalendar and DateTimePicker Controls to a Form (cont d.) DateTimePicker Control Displays a month calendar when the down arrow is selected 40

Adding MonthCalendar and DateTimePicker Controls to a Form (cont d.) 41

Adding MonthCalendar and DateTimePicker Controls to a Form (cont d.) 42

Working with a Form s Layout Blue snap lines Appear when you drag multiple Controls onto a Form Help align new Controls with others already in place Appear when you place a control closer to the edge of a container than is recommended Can use the Location property in the Properties list to specify a location 43

Working with a Form s Layout (cont d.) 44

Working with a Form s Layout (cont d.) Dock property Attaches a Control to the side of a container so that the Control stretches when the container s size is adjusted 45

Working with a Form s Layout (cont d.) 46

Working with a Form s Layout (cont d.) 47

Understanding GroupBoxes and Panels GroupBox or Panel Groups related Controls on a Form Can be docked inside a Form GroupBoxes Can display a caption Do not have scroll bars Panels Cannot display a caption Have scroll bars 48

Adding a MenuStrip to a Form Menu strip A horizontal list of general options that appears under the title bar of a Form or Window You can add a MenuStrip Control object to any Form you create When you double-click an entry in the MenuStrip, a Click() method is generated 49

Adding a MenuStrip to a Form (cont d.) 50

Adding a MenuStrip to a Form (cont d.) 51

Adding a MenuStrip to a Form (cont d.) 52

Using Other Controls If you click Project on the main menu and click Add New Item, you can add extra Forms, Files, Controls, and other elements to your project 53

You Do It Adding Labels to a Form and Changing Their Properties Examining the Code Generated by the IDE Adding CheckBoxes to a Form Adding RadioButtons to a Form 54