Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab2 Managing Controls.

Slides:



Advertisements
Similar presentations
Working with Intrinsic Controls and ActiveX Controls
Advertisements

Chapter 1: An Introduction to Visual Basic 2012
Using Macros and Visual Basic for Applications (VBA) with Excel
Chapter 3.1 Controls Programming In Visual Basic.NET.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Excel and VBA Creating an Excel Application
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.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab10 Interacting with Data (Database Management)
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab3 Check Boxes,Option Buttons Frame Control Frame Control MsgBox, InputBox Functions Day7.
Introduction to Computing Dr. Nadeem A Khan. Lecture 13.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab5 ListBox Control Properties, Methods and Events.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 بسم الله الرحمن الرحيم Palestine Polytechnic University College of Administrative science and.
Chapter 31 Visual Basic Controls A Form is a windows-style screen displayed by Visual Basic programs. In a form, a programmer can create objects in a form.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab8 Working with Forms Forms Collection Multiple Forms.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
Visual Basic Chapter 1 Mr. Wangler.
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Aligning the data in cells By default, Excel aligns text entries on the left margin of the cell (left justification) and aligns numeric entries on the.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
 2009 Pearson Education, Inc. All rights reserved Dive Into ® Visual C# 2008 Express.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Irwin/McGraw-Hill © The McGraw-Hill Companies, Inc., Visual Basic Projects Project Structure and VB’s Programming Tools chapter TWO.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Chapter Two Designing Applications Programming with Microsoft Visual Basic th Edition.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Managing Controls Lab 2 2 All Rgihs ReservedIsmail M. Romi – PPu: IT DEpt.
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.
Chapter 2 – Introduction to the Visual Studio .NET IDE
CHAPTER:07 JAVA IDE PROGRAMMING-II Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383
VB Objects & Events (Exercises) School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Friday 1/31/2003)
1 Visual Basic Part I - A tool for customizing your program Principles of GIS
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al- ajmi Chapter 3 Some Visual Basic Controls and Events Visual Basic. NET.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
Controls. Common properties Height – Height of the control Left – Left of the control Width – width of a control Top - From the screen top Font – Foreground.
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
Word Processor Version.01 EME 4411 Week 5. The Scroll Bars.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
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.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
1 Chapter 6: Creating Oracle Data Block Forms. 2 Forms  Application with a graphical user interface that looks like a paper form  Used to insert, update,
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
Visual Basic.NET Windows Programming
Microsoft Visual Basic 2005: Reloaded Second Edition
Chapter 1: An Introduction to Visual Basic 2015
Introduction to Computing
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Standard Controls.
3.Visual Basic Controls.
Presentation transcript:

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab2 Managing Controls

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 2 Controls (Tools)

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 3 Properties Set of attributes for each object used in VB, that changes the appearance and behavior of a Form or Control. Properties Types: 1- Design-time properties: properties than can be changed at the design mode. 2- Run-time properties: properties that can be changed at the run-time.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 4 Common Properties for controls See Table 3.1 page 65 Notes: –The Form’s Name property should be unique in the project. –The Control’s Name property should be unique on the same form. –Name property can be changed at the design mode only.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 5 The Form Object The background window that the user see during the program execution. The forms are given default names; Form1, From2… On the form you can place the controls from the toolbox required for the user interface.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 6 The Form’s Properties See Page 68. Caption: The text that appears in from’s title bar.. Icon: Displays an icon when the form is minimized. Picture: Image placed as a background to the form.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 7 Changing Form Properties at Run-Time Syntax: FormName.PropertyName = Value Examples: Form1.Caption = “ Student Record” Form1.Left = 0 Form1.MousePointer = vbHourglass Form1.MousePointer = 11

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 8 Form Events Load : Occurs during loading the form into main memory. Unload : Occurs when removing the form from main memory. Note: You can find all form and other Control’s events in the code window in the events ComboBox.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 9 The Pointer Tool The pointer tool is not a control. This tool used to deselect any selected control in the toolbox.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 10 The Label Control A control that displays uneditable text to the user. This control used to: 1- Provide a heading or description on the form. 2- Identify another control.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 11 The Label Control Properties Alignment: 0:Left, 1:right, 2:centered. Autosize: (True/False), adjusts the label control height and width to suit the text. Wordwrap: (True/False), to wrap the text into multiple lines. Font, Caption, Backcolor …… Events: Click, Dbclick……...

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 12 Changing Control Properties at Run-Time Syntax: FromName.ControlName.Property = Value Example: Form1.Label.Caption = “Student Name:” Form1.Label.Alignment = 1 Right justify

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 13 The Text Box Control A control used for accepting user input, and displaying text at the run-time. Properties: MaxLength: determines the maximum number of characters.(0:open). Multiline: (True/False), enables word wrap. Scrollbars: (0:no, 1:Horizontal, 2:Vertical, 3:Both), enables the user to scroll the text. Scrollbars related with multiline.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 14 Text Box Properties..[CONT] Locked: True/False Passwordchar: Determines the character that appears when the user enters a text. Text: Specifies the initial text that appears in the text box. Note: No caption property for text box

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 15 Text Box Events Change: Occurs when the vale of the text property is modified. Keypress, Keydown, Keyup…. Focus: The currently selected control. Gotfocus Event: Occurs when the control have the focus. Lostfocus:

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 16 Command Button Control A control that represents a button. The user press or clicks to initiate an action. Properties Caption: Specifies the text that appears in the button.When you precede a letter with &, that letter becomes the accelerator key. Default: (True/False). True:the button activates when ever the user press. Note only one can have this value on the form

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 17 Command Button Properties [CONT] Cancel: The same as default property, but the button activates when you press. Style: (0:Standard, 1:Graphical). Specifies whether the command button displays text or picture. Picture: Specifies a graphical image that appears on the command button. Note:Picture property depends on style property.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 18 Command Button Properties [CONT] Value: Run-Time property When you set the value of the command button to True, the command button’s Click Event activates. Example: Command1.Value = True Events: Click, Dbclick……..

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 19 Lab Training Example I : Design a VB project to perform the following: –Accept two numbers in text boxes. –Add two command buttons: Add, End –When you click Add, the result of addintion should appear in a label control. –When you click End the program end.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 20 Lab Training Questions Q1: Design a VB project to: –Add two TextBoxes to the form. –Add three command buttons (Check, Refresh,End). –Accept any two numbers in the textboxes. –When you click the Check command button the greatest number should appear in a label control. –When you click Refresh, all data should be removed from the controls. –When you click End the program end execution.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 21 Lab Training Q2: The following is the price list and discount policy for the telephone calls: Call Type Unit Price Discount-Units Internal0.5 First 100 units Between cities 1.2 3% of units more that 300 External % of the units which exceeds 100 unit. Design a VB project to calculate the Telephone invoice. The interface should be as follow:

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 22

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 23 Lab2 End