SlideShare a Scribd company logo
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 Presentation
GJ90
 
AcroButtonsTutorial
AcroButtonsTutorialAcroButtonsTutorial
AcroButtonsTutorial
tutorialsruby
 
Unity 5: First-Person Tutorial
Unity 5: First-Person TutorialUnity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
Shahed Chowdhuri
 
2 presentation management
2 presentation management2 presentation management
2 presentation management
Ruby Alagao-Corona
 
Microsoft office power point 2007 365
Microsoft office power point 2007 365Microsoft office power point 2007 365
Microsoft office power point 2007 365
Jayson Angelo Vale Cruz
 
Unity 5 Overview
Unity 5 OverviewUnity 5 Overview
Unity 5 Overview
Shahed Chowdhuri
 
Review chapter 1 3 part 2
Review chapter 1 3 part 2Review chapter 1 3 part 2
Review chapter 1 3 part 2
cbrmiller
 
Introduction to flash cs4
Introduction to flash cs4Introduction to flash cs4
Introduction to flash cs4
Vishal Raja
 
Introduction to powerpoint
Introduction to powerpointIntroduction to powerpoint
Introduction to powerpoint
BESOR ACADEMY
 
Lesson 2 presentation basics
Lesson 2   presentation basicsLesson 2   presentation basics
Lesson 2 presentation basics
guevarra_2000
 
New features in powerpoint 2012
New features in powerpoint 2012New features in powerpoint 2012
New features in powerpoint 2012
lkauffman01
 
VB.NET programming
VB.NET programmingVB.NET programming
VB.NET programming
Elrey Belga
 
Lesson5 Customizing windows
Lesson5  Customizing windowsLesson5  Customizing windows
Lesson5 Customizing windows
guevarra_2000
 
lecture 3
 lecture 3  lecture 3
lecture 3
umardanjumamaiwada
 
Beginning Game Development in XNA
Beginning Game Development in XNABeginning Game Development in XNA
Beginning Game Development in XNA
guest9e9355e
 
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

งานนำเสนอ1
งานนำเสนอ1งานนำเสนอ1
งานนำเสนอ1
Tömáñg Käëwnöppärät
 
Extending the web browser
Extending the web browserExtending the web browser
Extending the web browser
Secondary School
 
Texas Star Chart Campus Results
Texas Star Chart Campus ResultsTexas Star Chart Campus Results
Texas Star Chart Campus Results
Jana Cash
 
Dooms day
Dooms dayDooms day
Dooms day
Rosaiqbal
 
Mil senderos por recorrer
Mil senderos por recorrerMil senderos por recorrer
Mil senderos por recorrer
guadalinfolataha
 
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 browser
Secondary School
 
Virtualidad
VirtualidadVirtualidad
Virtualidad
jeanettejordan
 
Proyecto mil senderos por recorrer
Proyecto mil senderos por recorrerProyecto mil senderos por recorrer
Proyecto mil senderos por recorrer
guadalinfolataha
 
Administrative assistant ri-z
Administrative assistant ri-zAdministrative assistant ri-z
Administrative assistant ri-z
Rosaiqbal
 
Microbial fuel cell
Microbial fuel cellMicrobial fuel cell
Microbial fuel cell
Natalia Sacco
 
Coco Sugar
Coco SugarCoco Sugar
Coco Sugar
Sowmya Reddy
 
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 system
Haseeb 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 IV
Kenneth Osabal
 
Ppt lesson 03
Ppt lesson 03Ppt lesson 03
Ppt lesson 03
Linda Bodrie
 
Introduction
IntroductionIntroduction
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
IBM Rational software
 
06 win forms
06 win forms06 win forms
06 win forms
mrjw
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.ppt
LalRatan
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
sanket1996
 
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
 
Ch01
Ch01Ch01
Keynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptxKeynote + Next Gen UIs.pptx
Keynote + Next Gen UIs.pptx
EqraKhattak
 
Unity - Essentials of Programming in Unity
Unity - Essentials of Programming in UnityUnity - Essentials of Programming in Unity
Unity - Essentials of Programming in Unity
NexusEdgesupport
 
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 lectures
marwaeng
 
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
AOmaAli
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
Rooney Joh
 
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
Jeanie Arnoco
 
08graphics
08graphics08graphics
08graphics
Waheed Warraich
 
Let's make a game unity
Let's make a game   unityLet's make a game   unity
Let's make a game unity
Saija Ketola
 
Apps in a Flash HCI
Apps in a Flash HCIApps in a Flash HCI
Apps in a Flash HCI
Jonathan Goldman
 
Practical work 6
Practical work 6Practical work 6
Practical work 6
wkhairil80
 

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

Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 

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