SlideShare a Scribd company logo
1 of 20
AS Computing
    Unit F452
   Building Applications
    ◦ Creating computer applications in Visual Studio
    ◦ Creating program code using VB.NET
    ◦ Testing Code (when it goes wrong!)
   First thing you need to do in every Computing class is open
    Visual Studio. It can take a while so be patient…
You will create a ‘Windows Form Application’
that will allow you to choose and view a picture
in the window that your program runs in.

Follow the instructions on the following slides
to produce your first program!
TOOLBOX

                      PROJECT /
                      SOLUTION
                      EXPLORER
DESIGN
WINDOW


                        OBJECT
                      PROPERTIES



          CODE VIEW
   Requirements:
    ◦ To choose an image file
    ◦ To show the chosen image file as a picture in a
      window of a program
    ◦ To be able to quit/close the program when required
   File
    ◦ New
      Windows Form Application


   Give it the name ‘Picture Viewer’
   Go to the Properties Window
    ◦ Find Form 1 > Text
    ◦ Change the ‘Text’ property from ‘Form1’ to ‘Picture
      Viewer’
   Click the Save icon at the top!
              (do this quite often to prevent losing work)

   Change the Form Size
    ◦ Form Properties > Size
      Height > 500
      Width > 350
   Double-click to add objects:
    ◦ Add a ‘Button’ from the Toolbox with properties:
        Name       –     btnSelectPicture
        Location   –     295,10 (x and y coordinates!)
        Size       -     85,23
        Text       -     Select Picture
   Right click on the button, then copy, then
    paste within the form
   This will be the ‘Quit’ Button with properties:
      Name       –     btnQuit
      Location   –     295,40
      Text       -     Quit
   Back to the Toolbox
   Double click on ‘PictureBox’
   This need the following properties:
      Name          –   picShowPicture
      BorderStyle   -   FixedSingle
      Location      –   8,8
   SAVE!!!
   Toolbox
    ◦ Double-click OpenFileDialog (in Dialogs category)
    ◦ Note that it is hidden at the bottom!
   Select OpenFileDialog and set properties:
    ◦   Name        -     ofdSelectPicture
    ◦   Filename    -                      (leave this bit blank)
    ◦   Filter      -     Windows Bitmaps|*.BMP|JPEG Files|*.JPG
    ◦   Title       -     Select Picture
   Double-click on the ‘Select Picture’ button
    ◦ Now you can add code to make it do stuff!
   Enter the code from the following slides
' Show the open file dialog box

   If ofdSelectPicture.ShowDialog = DialogResult.OK Then

        ' Load the picture into the picture box

        picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName)

        ' Show the name of the file in the form's caption

        Me.Text = "Picture Viewer(" & ofdSelectPicture.FileName & ")"

   End If
' Close the window and exit the application
Me.Close()
   Click SAVE!
   Click the green RUN (triangle) button at the
    top in the main toolbar
   Try choosing a picture!
   Click ‘Quit’ to close your program
1.   What type of VB program creates a standard
     Windows program?
2.   What window is used to change attributes of
     a form or control in the IDE?
3.   How do you access the code of a control?
4.   What property of a picture box do you set to
     display an image?
5.   What is the default event for a button
     control?
1.   Windows Form Application
2.   Properties Window
3.   Double-click an object in design view
4.   The IMAGE property
5.   The CLICK event

More Related Content

What's hot

How to Make a PowerPoint Presentation
How to Make a PowerPoint PresentationHow to Make a PowerPoint Presentation
How to Make a PowerPoint PresentationGJ90
 
Unity 5: First-Person Tutorial
Unity 5: First-Person TutorialUnity 5: First-Person Tutorial
Unity 5: First-Person TutorialShahed Chowdhuri
 
Review chapter 1 3 part 2
Review chapter 1 3 part 2Review chapter 1 3 part 2
Review chapter 1 3 part 2cbrmiller
 
Introduction to flash cs4
Introduction to flash cs4Introduction to flash cs4
Introduction to flash cs4Vishal Raja
 
Introduction to powerpoint
Introduction to powerpointIntroduction to powerpoint
Introduction to powerpointBESOR ACADEMY
 
Lesson 2 presentation basics
Lesson 2   presentation basicsLesson 2   presentation basics
Lesson 2 presentation basicsguevarra_2000
 
New features in powerpoint 2012
New features in powerpoint 2012New features in powerpoint 2012
New features in powerpoint 2012lkauffman01
 
VB.NET programming
VB.NET programmingVB.NET programming
VB.NET programmingElrey Belga
 
Lesson5 Customizing windows
Lesson5  Customizing windowsLesson5  Customizing windows
Lesson5 Customizing windowsguevarra_2000
 
Beginning Game Development in XNA
Beginning Game Development in XNABeginning Game Development in XNA
Beginning Game Development in XNAguest9e9355e
 
MICROSOFT POWERPOINT 2013 " SLIDE LAYOUT "
MICROSOFT POWERPOINT 2013 " SLIDE LAYOUT "MICROSOFT POWERPOINT 2013 " SLIDE LAYOUT "
MICROSOFT POWERPOINT 2013 " SLIDE LAYOUT "Joshua Panambitan
 

What's hot (16)

How to Make a PowerPoint Presentation
How to Make a PowerPoint PresentationHow to Make a PowerPoint Presentation
How to Make a PowerPoint Presentation
 
AcroButtonsTutorial
AcroButtonsTutorialAcroButtonsTutorial
AcroButtonsTutorial
 
Unity 5: First-Person Tutorial
Unity 5: First-Person TutorialUnity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
 
2 presentation management
2 presentation management2 presentation management
2 presentation management
 
Microsoft office power point 2007 365
Microsoft office power point 2007 365Microsoft office power point 2007 365
Microsoft office power point 2007 365
 
Unity 5 Overview
Unity 5 OverviewUnity 5 Overview
Unity 5 Overview
 
Review chapter 1 3 part 2
Review chapter 1 3 part 2Review chapter 1 3 part 2
Review chapter 1 3 part 2
 
Introduction to flash cs4
Introduction to flash cs4Introduction to flash cs4
Introduction to flash cs4
 
Introduction to powerpoint
Introduction to powerpointIntroduction to powerpoint
Introduction to powerpoint
 
Lesson 2 presentation basics
Lesson 2   presentation basicsLesson 2   presentation basics
Lesson 2 presentation basics
 
New features in powerpoint 2012
New features in powerpoint 2012New features in powerpoint 2012
New features in powerpoint 2012
 
VB.NET programming
VB.NET programmingVB.NET programming
VB.NET programming
 
Lesson5 Customizing windows
Lesson5  Customizing windowsLesson5  Customizing windows
Lesson5 Customizing windows
 
lecture 3
 lecture 3  lecture 3
lecture 3
 
Beginning Game Development in XNA
Beginning Game Development in XNABeginning Game Development in XNA
Beginning Game Development in XNA
 
MICROSOFT POWERPOINT 2013 " SLIDE LAYOUT "
MICROSOFT POWERPOINT 2013 " SLIDE LAYOUT "MICROSOFT POWERPOINT 2013 " SLIDE LAYOUT "
MICROSOFT POWERPOINT 2013 " SLIDE LAYOUT "
 

Viewers also liked

Texas Star Chart Campus Results
Texas Star Chart Campus ResultsTexas Star Chart Campus Results
Texas Star Chart Campus ResultsJana Cash
 
mysql 1st. act.
mysql 1st. act.mysql 1st. act.
mysql 1st. act.von lozano
 
Button controls and using methods to make a simple web browser
Button controls and using methods to make a simple web browserButton controls and using methods to make a simple web browser
Button controls and using methods to make a simple web browserSecondary School
 
Proyecto mil senderos por recorrer
Proyecto mil senderos por recorrerProyecto mil senderos por recorrer
Proyecto mil senderos por recorrerguadalinfolataha
 
Administrative assistant ri-z
Administrative assistant ri-zAdministrative assistant ri-z
Administrative assistant ri-zRosaiqbal
 
Vigin Coconut Oil(VCO)
Vigin Coconut Oil(VCO)Vigin Coconut Oil(VCO)
Vigin Coconut Oil(VCO)Sowmya Reddy
 
C.V. David Labbé, M.Sc., agr., chm.
C.V. David Labbé, M.Sc., agr., chm.C.V. David Labbé, M.Sc., agr., chm.
C.V. David Labbé, M.Sc., agr., chm.davidlabbe
 
15.project attendence managemnt system
15.project attendence managemnt system15.project attendence managemnt system
15.project attendence managemnt systemHaseeb Nasir
 

Viewers also liked (15)

งานนำเสนอ1
งานนำเสนอ1งานนำเสนอ1
งานนำเสนอ1
 
Extending the web browser
Extending the web browserExtending the web browser
Extending the web browser
 
Texas Star Chart Campus Results
Texas Star Chart Campus ResultsTexas Star Chart Campus Results
Texas Star Chart Campus Results
 
Dooms day
Dooms dayDooms day
Dooms day
 
Mil senderos por recorrer
Mil senderos por recorrerMil senderos por recorrer
Mil senderos por recorrer
 
mysql 1st. act.
mysql 1st. act.mysql 1st. act.
mysql 1st. act.
 
Button controls and using methods to make a simple web browser
Button controls and using methods to make a simple web browserButton controls and using methods to make a simple web browser
Button controls and using methods to make a simple web browser
 
Virtualidad
VirtualidadVirtualidad
Virtualidad
 
Proyecto mil senderos por recorrer
Proyecto mil senderos por recorrerProyecto mil senderos por recorrer
Proyecto mil senderos por recorrer
 
Administrative assistant ri-z
Administrative assistant ri-zAdministrative assistant ri-z
Administrative assistant ri-z
 
Microbial fuel cell
Microbial fuel cellMicrobial fuel cell
Microbial fuel cell
 
Coco Sugar
Coco SugarCoco Sugar
Coco Sugar
 
Vigin Coconut Oil(VCO)
Vigin Coconut Oil(VCO)Vigin Coconut Oil(VCO)
Vigin Coconut Oil(VCO)
 
C.V. David Labbé, M.Sc., agr., chm.
C.V. David Labbé, M.Sc., agr., chm.C.V. David Labbé, M.Sc., agr., chm.
C.V. David Labbé, M.Sc., agr., chm.
 
15.project attendence managemnt system
15.project attendence managemnt system15.project attendence managemnt system
15.project attendence managemnt system
 

Similar to Introduction to computing

Technology and Livelihood Education IV
Technology and Livelihood Education IVTechnology and Livelihood Education IV
Technology and Livelihood Education IVKenneth Osabal
 
Creating an artifact at the project level
Creating an artifact at the project levelCreating an artifact at the project level
Creating an artifact at the project levelIBM Rational software
 
06 win forms
06 win forms06 win forms
06 win formsmrjw
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.pptLalRatan
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0sanket1996
 
Basic After Effect & Animation GIF (J&T Express)
Basic After Effect & Animation GIF (J&T Express)Basic After Effect & Animation GIF (J&T Express)
Basic After Effect & Animation GIF (J&T Express)IzzuwanIsmail
 
Keynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxKeynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxEqraKhattak
 
Unity - Essentials of Programming in Unity
Unity - Essentials of Programming in UnityUnity - Essentials of Programming in Unity
Unity - Essentials of Programming in UnityNexusEdgesupport
 
Adobe Illustrator CC 2018
Adobe Illustrator CC 2018 Adobe Illustrator CC 2018
Adobe Illustrator CC 2018 NYCCTfab
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lecturesmarwaeng
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxAOmaAli
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Jeanie Arnoco
 
Let's make a game unity
Let's make a game   unityLet's make a game   unity
Let's make a game unitySaija Ketola
 
Practical work 6
Practical work 6Practical work 6
Practical work 6wkhairil80
 

Similar to Introduction to computing (20)

Technology and Livelihood Education IV
Technology and Livelihood Education IVTechnology and Livelihood Education IV
Technology and Livelihood Education IV
 
Ppt lesson 03
Ppt lesson 03Ppt lesson 03
Ppt lesson 03
 
Introduction
IntroductionIntroduction
Introduction
 
Creating an artifact at the project level
Creating an artifact at the project levelCreating an artifact at the project level
Creating an artifact at the project level
 
06 win forms
06 win forms06 win forms
06 win forms
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.ppt
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Basic After Effect & Animation GIF (J&T Express)
Basic After Effect & Animation GIF (J&T Express)Basic After Effect & Animation GIF (J&T Express)
Basic After Effect & Animation GIF (J&T Express)
 
Ch01
Ch01Ch01
Ch01
 
Keynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxKeynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptx
 
Unity - Essentials of Programming in Unity
Unity - Essentials of Programming in UnityUnity - Essentials of Programming in Unity
Unity - Essentials of Programming in Unity
 
Adobe Illustrator CC 2018
Adobe Illustrator CC 2018 Adobe Illustrator CC 2018
Adobe Illustrator CC 2018
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptx
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
 
08graphics
08graphics08graphics
08graphics
 
Let's make a game unity
Let's make a game   unityLet's make a game   unity
Let's make a game unity
 
Apps in a Flash HCI
Apps in a Flash HCIApps in a Flash HCI
Apps in a Flash HCI
 
Practical work 6
Practical work 6Practical work 6
Practical work 6
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 

Recently uploaded (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 

Introduction to computing

  • 1.
  • 2. AS Computing Unit F452
  • 3. Building Applications ◦ Creating computer applications in Visual Studio ◦ Creating program code using VB.NET ◦ Testing Code (when it goes wrong!)
  • 4. First thing you need to do in every Computing class is open Visual Studio. It can take a while so be patient…
  • 5.
  • 6. You will create a ‘Windows Form Application’ that will allow you to choose and view a picture in the window that your program runs in. Follow the instructions on the following slides to produce your first program!
  • 7. TOOLBOX PROJECT / SOLUTION EXPLORER DESIGN WINDOW OBJECT PROPERTIES CODE VIEW
  • 8. Requirements: ◦ To choose an image file ◦ To show the chosen image file as a picture in a window of a program ◦ To be able to quit/close the program when required
  • 9. File ◦ New  Windows Form Application  Give it the name ‘Picture Viewer’
  • 10. Go to the Properties Window ◦ Find Form 1 > Text ◦ Change the ‘Text’ property from ‘Form1’ to ‘Picture Viewer’  Click the Save icon at the top! (do this quite often to prevent losing work)  Change the Form Size ◦ Form Properties > Size  Height > 500  Width > 350
  • 11. Double-click to add objects: ◦ Add a ‘Button’ from the Toolbox with properties:  Name – btnSelectPicture  Location – 295,10 (x and y coordinates!)  Size - 85,23  Text - Select Picture
  • 12. Right click on the button, then copy, then paste within the form  This will be the ‘Quit’ Button with properties:  Name – btnQuit  Location – 295,40  Text - Quit
  • 13. Back to the Toolbox  Double click on ‘PictureBox’  This need the following properties:  Name – picShowPicture  BorderStyle - FixedSingle  Location – 8,8  SAVE!!!
  • 14. Toolbox ◦ Double-click OpenFileDialog (in Dialogs category) ◦ Note that it is hidden at the bottom!  Select OpenFileDialog and set properties: ◦ Name - ofdSelectPicture ◦ Filename - (leave this bit blank) ◦ Filter - Windows Bitmaps|*.BMP|JPEG Files|*.JPG ◦ Title - Select Picture
  • 15. Double-click on the ‘Select Picture’ button ◦ Now you can add code to make it do stuff!  Enter the code from the following slides
  • 16. ' Show the open file dialog box If ofdSelectPicture.ShowDialog = DialogResult.OK Then ' Load the picture into the picture box picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName) ' Show the name of the file in the form's caption Me.Text = "Picture Viewer(" & ofdSelectPicture.FileName & ")" End If
  • 17. ' Close the window and exit the application Me.Close()
  • 18. Click SAVE!  Click the green RUN (triangle) button at the top in the main toolbar  Try choosing a picture!  Click ‘Quit’ to close your program
  • 19. 1. What type of VB program creates a standard Windows program? 2. What window is used to change attributes of a form or control in the IDE? 3. How do you access the code of a control? 4. What property of a picture box do you set to display an image? 5. What is the default event for a button control?
  • 20. 1. Windows Form Application 2. Properties Window 3. Double-click an object in design view 4. The IMAGE property 5. The CLICK event

Editor's Notes

  1. Software – instructions and data which enable the hardware to perform useful tasks.Event Driven – VB code is associated with objects and each object has a set of events assoc with it.Events are actions which VB detects and responds to. E.g. a user clicks on a button on a form (demo SIMS), that will generate a click event for that button i.e. what happens when the button is pressed. When an event is generated, VB will run any code (INSTRUCTIONS) that you have entered for that event.
  2. Text entered into the Title bar appears in the open file dialog box that opens later
  3. Clicking on a button is called an event. The code that you put in the button is called an event handler, ie it tells the program the instructions to carry out once the button is clicked.
  4. Finished code: Private Sub btnSelectPicture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectPicture.Click ' Show the open file dialog box. If ofdSelectPicture.ShowDialog = DialogResult.OK Then ' Load the picture into the picture box. picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName) ' Show the name of the file in the form's caption. Me.Text = "Picture Viewer(" & ofdSelectPicture.FileName & ")" End If End SubComments in green
  5. Finished code: Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click ' Close the window and exit the application Me.Close() End SubComments in green
  6. Finished code: Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click ' Close the window and exit the application Me.Close() End SubComments in green