A short ppt Importing images Changing fonts. Getting images.

Slides:



Advertisements
Similar presentations
Midterm 26 March 2015 (4:30-5:30 pm) – Rm5620 Closed book exam MC Questions only x25 Up to L(7) Methods Scope: video lectures (+Lab), forum discussions,
Advertisements

Practical Programming COMP153-08S Lecture: Repetition Continued.
Making a cartoon or slideshow. Aside VB comments An apostrophe starts a comment to end of line Some of the following slides have code with comments in.
Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
VB.Net Loops.
Collections and classes. Projects in this ppt Collection interface practice The microwave oven simulator Bank account.
Coding ADO.Net DataSet Objects. DataSet Object A DataSet object can hold several tables and relationships between tables. A DataSet is a set of disconnedted.
An array of controls Not particularly convenient in VB Examples: array of pictureboxes Array of textboxes Notes on Concentration game (a possible final.
Visual Basic 3 Some new components Some new capabilities OOD/OOP.
Arrays & Strings part 2 More sophisticated algorithms, including sorting.
More on lists, exceptions, loops and validation. You can use the exception to indicate the error that occurred Private Sub btnCheck_Click(ByVal sender.
VB.Net Loops. Loop FOR index – start TO end [STEP step] [statements] [EXIT FOR] NEXT index DO [{WHILE| UNTIL} condition] [statements] [EXIT DO] LOOP.
Arrays One dimensional arrays. Index of projects Random picture display Sum array values Display names in listbox Name search Largest/smallest Car sales.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 3 – Fundamentals of Programming in VB.NET VB.NET Controls VB.NET Events Numbers Strings Input and Output.
COMPUTER PROGRAMMING I Objective 7.03 Apply Built-in Math Class Functions.
1 CC111 Lec9 : Visual Basic Visual Basic (3) Lecture 9.
COMPUTER PROGRAMMING I SUMMER Apply operators and Boolean expressions.
Visual Basic.NET Windows Forms Hello World Homework Assignment.
Some graphics. Projects included A slideshow a dark moon moving phases of the moon billiards Your own icons and bitmaps Pie chart.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Unit 3: Adding Code to a Microsoft ASP.NET Web Form.
1 Week 6 The Repetition Structure. 2 The Repetition Structure (Looping) Lesson A Objectives After completing this lesson, you will be able to:  Code.
1 COMP3100e Developing Microsoft.Net Applications for Windows (Visual Basic.Net) Class 6 COMP3100E.
Tutorial 6 The Repetition Structure
CIS 338: Classes and Modules Dr. Ralph D. Westfall May, 2011.
CS0004: Introduction to Programming Project 1 – Lessons Learned.
6c – Function Procedures Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
1 Advanced Computer Programming Lab Calculator Project.
4-1 Chapter 4 The Selection Process in VB.NET. 4-2 Learning Objectives Understand the importance of the selection process in programming. Describe the.
COPYRIGHT 2010: Dr. David Scanlan, CSUS OBJECTIVES: How to write classes How to create an object from a class using the "New" keyword. How to communicate.
PRACTICE SAC 1 Some solutions. 'inputs 'sale price 'postcode 'coupon codes 'processing 'calculate commissions (commission based on cost) 'calculate postage.
Created by Alia Al-Abdulkarim 2008 Visual Basic Vs. Java.
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.
Lab 10 Slides.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 1 Unit 3 Formatting Chapter 3 Input, Variables, Constants,
Practical Programming COMP153-08S Lecture: Repetition.
ADO.NET Objects Data Adapters Dr. Ron Eaglin. Agenda Builds on Information in Part I Should have working knowledge of creating a database connection Continuation.
Introduction to VB programming Dr. John P. Abraham UTPA Chapters 2 & 3.
IMS 3253: Forms, Controls, Properties, Events 1 Dr. Lawrence West, MIS Dept., University of Central Florida Topics Program Elements Assignment.
CIS 338: Events Dr. Ralph D. Westfall April, 2011.
T HE W ALKING FOR W ATER P ROJECT IE 2060 Katelyn Cockrell Alexis Duran Theresa Garcia.
Visual Basic Declaring Variables Dim x as Integer = 0 In the statement above, x is being declared as an Integer (whole number) and is initialised.
Computer Science Up Down Controls, Decisions and Random Numbers.
Directory and File. Access Files in a Directory Name space: System.IO The Directory and File classes contain only shared methods that set or return information.
Dr. Abraham Professor UTPA Graphical User Interface.
VB.NET User Interface Controls. VB User Interface Objects Form InputBox, MessageBox Standard Controls: –TextBox, MaskedTextBox, List Box, Option Button,
Visual Basic Fundamental Concepts
UNIT 1 Lesson 1 Introduction.
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Objective 7.03 Apply Built-in Math Class Functions
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Introduction to VB programming
TreeView Control.
للمزيد زورونا على موقعنا الإلكتروني:
Chapter#9: A Deeper Look In Controls
Visual Basic..
Boolean Expressions and If statements
1.الدوال Function 2.الاجراءاتSub Procedure 3.وحده نمطيه Add Module
CIS16 Application Development and Programming using Visual Basic.net
Fundamentals of Programming in VB.Net
Part 2 Saving the Dictionary
CIS 338: Images on Forms Dr. Ralph D. Westfall May, 2009.
Setting Properties of Objects
Presentation transcript:

A short ppt Importing images Changing fonts

Getting images

Combobox & image.fromFile

Combo box Select the collection property to populate the combo box I used Picturebox.image=image.fromfile(“C:\penguin.gif”); My combobox selected index changed sub code is below: If cbbchoose.Text = "dog" Then pb.Image = Image.FromFile("c:\dog.gif") ElseIf cbbchoose.Text = "bear" Then pb.Image = Image.FromFile("c:\bear.gif") Else pb.Image = Image.FromFile("c:\penguin.gif") 'pb.Refresh() End If Note: I didn’t take time to figure out how to get it to look in the application directory

Changing fonts via button press

I didn’t figure out how to get a font literal in this application

code Private Sub btnfont3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfont3.Click lbldisplay.Font = btnfont3.Font() End Sub Private Sub btnfont1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfont1.Click lbldisplay.Font = btnfont1.Font() End Sub Private Sub btnfont2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfont2.Click lbldisplay.Font = btnfont2.Font() End Sub

Literal font names

Press button to change font

code Private Sub btn3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn3.Click Dim f As New System.Drawing.Font("Arial", 10) ' Assign the font to the control lbl1.Font = f ' To set additional properties, you must create a new Font object. lbl1.Font = f 'lbl1.Font = New System.Drawing.Font(lbl1.Font, FontStyle.Bold Or FontStyle.Italic) End Sub Private Sub Btn2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn2.Click Dim f As New System.Drawing.Font("Symbol", 12) lbl1.Font = f ' or use... 'lbl1.Font = New System.Drawing.Font(f, FontStyle.Bold) End Sub Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click Dim f As New System.Drawing.Font("SansSerif", 12) lbl1.Font = f lbl1.Font = New System.Drawing.Font(lbl1.Font, FontStyle.Underline) End Sub

Image.fromfile(“P:\...”) does work in F306 lab: a screenshot

Code for previous slide Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load PictureBox1.Image = Image.FromFile("p:\africa1.jpg") End Sub