SlideShare a Scribd company logo
Introduction to computing
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…
Introduction to computing
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 (16)

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
 
How to Make a PowerPoint Presentation
How to Make a PowerPoint PresentationHow to Make a PowerPoint Presentation
How to Make a PowerPoint Presentation
GJ90
 
Unity 5: First-Person Tutorial
Unity 5: First-Person TutorialUnity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
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
 
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
 

Viewers also liked (15)

งานนำเสนอ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
 
Texas Star Chart Campus Results
Texas Star Chart Campus ResultsTexas Star Chart Campus Results
Texas Star Chart Campus Results
Jana 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 browser
Secondary School
 
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
 
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
 
Ad

Similar to Introduction to computing (20)

M14 overview
M14 overviewM14 overview
M14 overview
obrienduke
 
Image contro, and format functions in vb
Image contro, and format functions in vbImage contro, and format functions in vb
Image contro, and format functions in vb
Amandeep Kaur
 
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
 
Introduction
IntroductionIntroduction
Introduction
شكسبير ويليام
 
Introduction to Visual Studio 2022-OS.ppt
Introduction to Visual Studio 2022-OS.pptIntroduction to Visual Studio 2022-OS.ppt
Introduction to Visual Studio 2022-OS.ppt
claritoBaluyot2
 
01 form-mdi
 01 form-mdi 01 form-mdi
01 form-mdi
Warawut
 
Putting dialog boxes to work
Putting dialog boxes to workPutting dialog boxes to work
Putting dialog boxes to work
chunky.sarath
 
Vb lecture notes
Vb lecture notesVb lecture notes
Vb lecture notes
alldesign
 
INTRODUCTION TO VISUAL BASICS
INTRODUCTION TO VISUAL BASICS INTRODUCTION TO VISUAL BASICS
INTRODUCTION TO VISUAL BASICS
Prof Ansari
 
Graphics
GraphicsGraphics
Graphics
obrienduke
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
Moutasm Tamimi
 
Filehandling
FilehandlingFilehandling
Filehandling
Amandeep Kaur
 
Visual basic
Visual basicVisual basic
Visual basic
KavithaAlagumalai
 
Ppt lesson 03
Ppt lesson 03Ppt lesson 03
Ppt lesson 03
Linda Bodrie
 
Visual Basic.pptx
Visual Basic.pptxVisual Basic.pptx
Visual Basic.pptx
KavithaAlagumalai
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
marwaeng
 
Vs c# lecture1
Vs c# lecture1Vs c# lecture1
Vs c# lecture1
Saman M. Almufti
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
Salim M
 
Chapter 06
Chapter 06Chapter 06
Chapter 06
Terry Yoast
 
Deepika Mittal , BCA Third Year
Deepika Mittal , BCA Third YearDeepika Mittal , BCA Third Year
Deepika Mittal , BCA Third Year
dezyneecole
 
Image contro, and format functions in vb
Image contro, and format functions in vbImage contro, and format functions in vb
Image contro, and format functions in vb
Amandeep Kaur
 
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
 
Introduction to Visual Studio 2022-OS.ppt
Introduction to Visual Studio 2022-OS.pptIntroduction to Visual Studio 2022-OS.ppt
Introduction to Visual Studio 2022-OS.ppt
claritoBaluyot2
 
01 form-mdi
 01 form-mdi 01 form-mdi
01 form-mdi
Warawut
 
Putting dialog boxes to work
Putting dialog boxes to workPutting dialog boxes to work
Putting dialog boxes to work
chunky.sarath
 
Vb lecture notes
Vb lecture notesVb lecture notes
Vb lecture notes
alldesign
 
INTRODUCTION TO VISUAL BASICS
INTRODUCTION TO VISUAL BASICS INTRODUCTION TO VISUAL BASICS
INTRODUCTION TO VISUAL BASICS
Prof Ansari
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
Moutasm Tamimi
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
marwaeng
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
Salim M
 
Deepika Mittal , BCA Third Year
Deepika Mittal , BCA Third YearDeepika Mittal , BCA Third Year
Deepika Mittal , BCA Third Year
dezyneecole
 
Ad

Recently uploaded (20)

Exploring Identity Through Colombian Companies
Exploring Identity Through Colombian CompaniesExploring Identity Through Colombian Companies
Exploring Identity Through Colombian Companies
OlgaLeonorTorresSnch
 
How to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guidesHow to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guides
Celine George
 
How to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time OffHow to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time Off
Celine George
 
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo SlidesHow to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
Celine George
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
 
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
wygalkelceqg
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
POS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 SlidesPOS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 Slides
Celine George
 
Order Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptxOrder Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptx
Arshad Shaikh
 
Order: Odonata Isoptera and Thysanoptera.pptx
Order: Odonata Isoptera and Thysanoptera.pptxOrder: Odonata Isoptera and Thysanoptera.pptx
Order: Odonata Isoptera and Thysanoptera.pptx
Arshad Shaikh
 
Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18
Celine George
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
How to Use Owl Slots in Odoo 17 - Odoo Slides
How to Use Owl Slots in Odoo 17 - Odoo SlidesHow to Use Owl Slots in Odoo 17 - Odoo Slides
How to Use Owl Slots in Odoo 17 - Odoo Slides
Celine George
 
How to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 WebsiteHow to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 Website
Celine George
 
Types of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo SlidesTypes of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo Slides
Celine George
 
K-Circle-Weekly-Quiz-May2025_12345678910
K-Circle-Weekly-Quiz-May2025_12345678910K-Circle-Weekly-Quiz-May2025_12345678910
K-Circle-Weekly-Quiz-May2025_12345678910
PankajRodey1
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
Muneeb Rana
 
Exploring Identity Through Colombian Companies
Exploring Identity Through Colombian CompaniesExploring Identity Through Colombian Companies
Exploring Identity Through Colombian Companies
OlgaLeonorTorresSnch
 
How to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guidesHow to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guides
Celine George
 
How to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time OffHow to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time Off
Celine George
 
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo SlidesHow to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
Celine George
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
 
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
wygalkelceqg
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
POS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 SlidesPOS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 Slides
Celine George
 
Order Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptxOrder Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptx
Arshad Shaikh
 
Order: Odonata Isoptera and Thysanoptera.pptx
Order: Odonata Isoptera and Thysanoptera.pptxOrder: Odonata Isoptera and Thysanoptera.pptx
Order: Odonata Isoptera and Thysanoptera.pptx
Arshad Shaikh
 
Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18
Celine George
 
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
SEM II 3202 STRUCTURAL MECHANICS, B ARCH, REGULATION 2021, ANNA UNIVERSITY, R...
RVSPSOA
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
How to Use Owl Slots in Odoo 17 - Odoo Slides
How to Use Owl Slots in Odoo 17 - Odoo SlidesHow to Use Owl Slots in Odoo 17 - Odoo Slides
How to Use Owl Slots in Odoo 17 - Odoo Slides
Celine George
 
How to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 WebsiteHow to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 Website
Celine George
 
Types of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo SlidesTypes of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo Slides
Celine George
 
K-Circle-Weekly-Quiz-May2025_12345678910
K-Circle-Weekly-Quiz-May2025_12345678910K-Circle-Weekly-Quiz-May2025_12345678910
K-Circle-Weekly-Quiz-May2025_12345678910
PankajRodey1
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
Muneeb Rana
 

Introduction to computing

  • 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…
  • 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

  • #4: 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.
  • #15: Text entered into the Title bar appears in the open file dialog box that opens later
  • #16: 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.
  • #17: 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
  • #18: 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
  • #19: 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