CST238 Week 4 Questions / Concerns? Announcements – Start thinking about project ideas – Test#1 next Monday, 4/28/14 Recap Check-off Take Home Lab#3 New.

Slides:



Advertisements
Similar presentations
 2007 Dr. Natheer Khasawneh. Chapter 13. Graphical User Interface Concepts: Part 1.
Advertisements

Chapter 1: An Introduction to Visual Basic 2012
Using Macros and Visual Basic for Applications (VBA) with Excel
CST238 Week 3 Questions / Concerns? Recap Check-off Take Home Lab#2 New topics – PictureBox – FlowLayoutPanel – Menu – Context Menu – Status Bar – Toolstrip.
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second 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.
MDI windows Single-document-interface (SDI)
Multiple Document Interface (MDI) application
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Operating Systems Day 4. Cascade Windows 1.Open one or more windows 2.Right click on task bar 3.Click cascade windows menu item Tile Windows 1.Open one.
Tutorial 6 Using Form Tools and Creating Custom Forms
1 Graphical User Interfaces Part 2 Outline Multiple Document Interface (MDI) Windows Visual Inheritance User-Defined Controls.
Defining Styles and Automatically Creating Table of Contents and Indexes Word Processing 4.03.
CST-092 © Delta College CST FacultyIntroduction to Windows Operating System Lecture 2.
® Microsoft Access 2010 Tutorial 6 Using Form Tools and Creating Custom Forms.
CST238 Week 5 Questions / Concerns? Announcements – HW#1 due (Project ideas) – Check-off Take Home lab#4 Recap New topics – Drawing Coming up: – GUI Bloopers.
Dr Dat Tran - Week 4 Lecture Notes 1 MenuStrip Programming Graphical User Interfaces PG (7110) University of Canberra School of Information Sciences &
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
Using Form Tools and Creating Custom Forms Microsoft Access 2010.
IE 411/511: Visual Programming for Industrial Applications
MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI.
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
CHAPTER 9 Introducing Microsoft Office Learning Objectives Start Office programs and explore common elements Use the Ribbon Work with files Use.
1 Working with Menus and Dialog Boxes. 2 Objectives You will be able to Create and edit menus for Windows Forms applications. Write code to handle menu.
Dr Dat Tran - Week 4 Lecture Notes 1 ToolStrip Programming Graphical User Interfaces PG (7110) University of Canberra School of Information Sciences &
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Happy Monday!!!  Open the Agenda  Copy it in your Agenda form.  Wait for further instructions.
Key Applications Module Lesson 21 — Access Essentials
COMPREHENSIVE Access Tutorial 6 Using Form Tools and Creating Custom Forms.
VB.NET Additional Topics
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
RIGHT Mouse Button Formatting Cut Copy Paste Save LEFT Mouse Button MAIN BUTTON Single clicks Double clicks Drag Highlight.
Basic Editing Lesson 2.
BIM211 – Visual Programming Interacting with Users Graphics 1.
1 Chapter Nine Using GUI Objects and the Visual Studio IDE.
Taskbar. START TASKBAR Programs Start Menu has the seven basics commands: Programs, Documents, Settings, Find, Help, Run, and Shut down.
C# GUI - Basics. Objectives.NET supports two types: WinForms, traditional, desktop GUI apps. WebForms – newer, for Web apps. Visual Studio.NET supports.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Lecture 7 Dialog Controls MDI Parent/Child Interaction.
By: Ms. Abeer Helwa 1. CREATE A WORD DOCUMENT 2 Blank document Templates To create a new blank document: click the File tab and click Blank document.
Lesson: 2 Common Features and Commands After completing this lesson, you will be able to: Identify the main components of the user interface. Identify.
Lesson 1 - Understanding the Word Window and Creating a New Document
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
1 After completing this lesson, you will be able to: Create a form using AutoForm. Create a form using the Form Wizard. Add controls to a form. Modify.
Compound Data Types Part13dbg. 2 Point A Point is a simple built-in struct that stores a pair of screen coordinates. Instantiate a Point: Point aPoint.
DateTime, Code Regions, and Multiple Form Applications Part13dbg.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Adobe ® Photoshop ® CS6 Chapter 1 Editing a Photo.
PowerPoint Chapter 1 Creating and Editing a Presentation with Clip Art Discovering Computers & Microsoft Office 2010.
1 Word Processing Intermediate Using Microsoft Office 2000.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
Module 3: Creating Windows-based Applications. Overview Creating the Main Menu Creating and Using Common Dialog Boxes Creating and Using Custom Dialog.
Dialog Boxes Getting information from user. Types of Windows Five types we’ll be using 1. Main Application Window 2. Child Windows 3. Dialog Boxes 4.
Chapter 1: An Introduction to Visual Basic .NET
Microsoft Visual Basic 2005: Reloaded Second Edition
Microsoft Access 2007 – Level 2
Customizing the Quick Access Toolbar in Microsoft Office
Chapter 2 – Introduction to the Visual Studio .NET IDE
Chapter 1: An Introduction to Visual Basic 2015
Using GUI Objects and the Visual Studio IDE
Chapter 1 Editing a Photo
Defining Styles and Automatically Creating Table of Contents and Indexes Word Processing 4.03.
Picture Viewer.
Multi-form applications and dialogs
Copyright © 2006 Thomas P. Skinner
Module 8: Creating Windows-based Applications
6. WinForms 2003 C# GUI - Basics.
Presentation transcript:

CST238 Week 4 Questions / Concerns? Announcements – Start thinking about project ideas – Test#1 next Monday, 4/28/14 Recap Check-off Take Home Lab#3 New topics – Dialogs (user-defined dialogs) – Timer control – DateTime object – Richtextbox – MDI (Multiple Document Interface) Parent/child form relationship Richtextbox – open, save, cut, copy, paste In-Class Exercise #4 Take Home Lab#4

Recap Picturebox – Image property – Load method Layout controls – Table – Flow layout Menu Toolbar Status bar Working with C# arrays

Dialog Forms that: – Provide information to the user, or – Request information from the user Generally modal – Cannot switch forms until dialog is closed. Several dialogs included with Windows Forms – MessageBox, Color, OpenFile, SaveFile, Print, etc. You can create your own custom dialog

Working with Dialogs Simple Dialogs – Just a function call MessageBox.Show() Common/Custom Dialog – Create instance of dialog – Set properites – Show dialog using ShowDialog method Returns a meber of the DialogResult enumeration – Take action based on dialog result

Working with Dialog OpenFieDialog openFile1 = new OpenFileDialog(); openFile1.Filter = “JPEG Files (*.jpg)|*.jpg|PNG Files (*.png)|*.png|BMP Files (*.bmp)|*.bmp|All files (*.*)|*.*”; if (openFile1.ShowDialog() == DialogResults.OK) { //Do something with OpenFile1.FileName //which is the filename selected by the user if (openFile1.ShowDialog() == DialogResult.OK) { pictureBox1.Load(openFile1.FileName); }

Working with Color Dialog ColorDialog colorDialog1 = new ColorDialog(); if (colorDialog1.ShowDialog() == DialogResult.OK) pictureBox1.BackColor = colorDialog1.Color; //selected color

Custom Dialog Create form as you would any other Set form properties to add dialog look, feel and behavior – Set FormBorderStyle to FixedDialog Disables resizing of dialog – Set ControlBox property to false Removes minimize, maximize and close buttons from title bar – Set AcceptButton and CancelButton properties AcceptButton - pressing Enter is the same as clicking the button CancelButton – pressing Escape is the same as clicking the button Set dialog return value on button clicks – In event handler, or – Using the DialogResult property of the button

Timer Control Add a timer control to the form Set its interval – 1000 ms = 1 second Set its Tick event handler to handle the timer event at every interval

DateTime DateTime object in C# returns the current date and time. Custom Date and Time Format Strings: Example: private DateTime timeOfDay; Private string timeString; private string hour; private string minute; timeOfDay = DateTime.Now; timeString = timeOfDay.ToString("hh:mm:ss"); hour = timeOfDay.Hour.ToString("00"); minute = timeOfDay.Minute.ToString("00");

Richtextbox Supports – Cut – Copy – Paste – SelectAll – SaveFile(filename) – LoadFile(filename) – SelectionColor – SelectionFont

MDI

Multiple Document Interface (MDI)

MDI Apps Main Form – Set IsMdiContainer to true – Use ActiveMdiChild to get reference to active child form – Use MdiChildren to get collection of child forms – Use LayoutMdi to arrange child forms Child forms – Set MdiParent to main form on creation – Use MdiParent to get reference back to main form

MDI Windows menu – Arrange the windows in Cascade – Arrange the windows in Tile Horizontally – Arrange the windows in Tile Vertically Menustrip Control – Set MdiWindowList This will show a list of active child windows

Access the Active Child form if (this.ActiveMdiChild != null) { //cast the ActiveMdiChild to the right form type ChildForm child=(ChildForm)this.ActiveMdiChild; //do something with childform’s control child.documentTextbox.Undo(); } documentTextbox is private. It needs to be internal. Change its modifier in the Properties window.

private vs. internal All controls on a form are default to private modifier. – Only available to the containing form In order for the Main Form to access the Childform’s control, the control’s modifier would have to be changed. – internal means that they are in the same assembly (.exe or.dll)

Modifiers

In-Class Lab#4 Finish the MDI application by finishing the Open, Save, Cut, Copy,Paste, Change Font and Change Color menu options. When open a new childForm window, set its title appropriately. Be sure to change the childForm window title to the saved/opened filename.

Take-Home Exercise #4 Build a Tix Clock This is a Tix Clock showing 15:43.

Tix Clock Use pictureboxes to simulate color LEDs. Use random number to randomly color squares. Tix clocks are updated every 4 seconds. Use DateTime to get the current time. Be sure to grab 2 digits for hour and 2 digits for minute.