SlideShare uma empresa Scribd logo
1 de 24
OBJECTIVES 
•Understand what is an object 
•Learn the properties, methods 
and events that correspond with 
an object 
•Learn the use of the Properties 
Window
Everything in Visual Basic 
revolves around what is 
called as OBJECTS. 
Objects are a distinct unit in a 
program that has a certain 
characteristics and can perform 
certain actions.
Objects have PROPERTIES, just like a real-world 
object, properties determines what physical 
appearance your object will look like. You can change 
the different properties of each objects. 
ObjectName.Property=Value 
Object Name = Name of the object with the properties to 
change 
Property = attribute you want to change 
Value = New data of the property
Form1.Caption=“Welcome”
• You can also change 
the Property of an 
object at design time 
by using the Properties 
Window in Visual 
Basic.
Objects can also perform functions of their own. The 
whole point of creating objects is that objects does 
something useful. This additional functions are known 
as METHODS. This allows the objects to perform 
certain actions. 
ObjectName.Method Value 
Object Name = Name of the object with the properties to 
change 
Method = action to perform 
Value = Optional parameters or data you can add
Form1.Show
To add data to a ComboBox we can use 
the methods optional parameter 
Combo1.AddItem “IV-Malory”
The form is the basic repository for all you controls, this is were 
you add all those controls when you design the user interface. A 
program can have one or more forms. The form that first appear 
when you run you program is called the startup form. 
You can change the order of the startup of each form by: 
1. Clicking Project from the menu bar 
2. Select Project1 Properties 
3. The Project Properties will appear 
4. Click the Startup Object combo box 
5. Select from the list of forms 
6. Then click the OK button
Each form and control has properties 
assigned to it by default when you start up 
a new project. There are two ways to 
display the properties of an object. The 
first way is to click on the object (form or 
control) in the form window. Then, click on 
the Properties Window or the Properties 
Window button in the tool bar. The second 
way is to first click on the Properties 
Window. The select the object from the 
Object box in the Properties Window. 
Properties can be viewed in two ways: 
• Alphabetic 
• Categorized
 Each object has a set of attributes, 
called properties, that determine its 
appearance and behavior 
 The Properties window exposes the 
object’s properties to the programmer 
 The Properties window includes an 
Object box and a Properties list 
 The Properties window can be used to 
change a property of an object
Properties window showing 
the properties of the 
Form1.vb file object
 The Windows Form object has a set 
of properties 
 Properties of the Windows Form 
object will appear in the Properties 
window when you select the 
Windows Form object in the 
designer window
Important properties of the Windows 
Form object: 
 Name property 
 Text property 
 StartPosition property 
 Size property 
 BackgroundImage property
You can also set or modify properties while 
your application is running . To do this, you 
must write some code. The code format is: 
ObjectName.Property = NewValue 
Such a format is referred to as dot notation. 
For example, to change the BackColor 
property of a form name Form1, we’d type: 
Form1.BackColor = vbBlue
The names you assign to objects are used by 
Visual Basic to set up a framework of event-driven 
procedures for you to add code to. The 
format for each of these subroutines (all 
object procedures in VB are subroutines) is: 
Sub ObjectName_Event (Optional Arguments) 
End Sub 
VB provides the Sub line with its arguments 
(if any) and the End Sub statement. You 
provide any needed code.
Several form events will fire starting with the moment of 
creation. Each has its own purpose and triggers in a certain 
order. When the Form is first created, an initialize event will 
occur, followed by Load, Resize, and Paint. 
1. Start VB and create a new project 
2. Double-click the form 
3. The Code Window will appear, by default 
you’ll be in the Load event procedure, click 
on the events combo box, scroll through and 
select the Click event. 
4. You’ll now have two event procedure (Load and 
Click) 
5. Click inside the Form_Click event and type 
the following statement 
6. Your code window should look like the one in 
the next slide.
Private Sub Form_Click() 
Msg “Welcome to Malory” 
End Sub
Properties Description 
Caption Changes the caption of the title bar in the form 
Window. 
Appearance Changes the 3D or Flat appearance of the form 
BackColor Changes the form background color 
Font Changes the Font style of the form 
Enable Sets True of False boolean data, disables and 
enable the form 
Picture Puts a picture on the form 
Visible Hide or unhide the form by setting it True or 
False 
ForeColor Changes the color of the text
Events Description 
Load Triggers once the program starts 
Unload Triggers once the program exits 
Activate Triggers once the form is active 
Click Triggers once the form is click 
Double Click Triggers once the form is double click 
Terminate Like Initialize, this event will only occur during 
the existing of the Form. It won’t fire if the 
program is terminated abnormally 
Initialize This event occurs only once when the Form is 
created. It will not fire again unless the Form is 
Unloaded and Loaded again
Methods Description 
Hide Hides the active form 
Unhide Unhide the active form 
Print Use to print text on the form 
Cls Clear any picture on the form
Submitted by: Group 4

Mais conteúdo relacionado

Mais procurados

Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7helpido9
 
Publisher 2007
Publisher 2007Publisher 2007
Publisher 2007abedies
 
The Objects Toolbar in MS Publisher
The Objects Toolbar in MS PublisherThe Objects Toolbar in MS Publisher
The Objects Toolbar in MS PublisherRolly Franco
 
Ms publisher parts and functions
Ms publisher parts and functionsMs publisher parts and functions
Ms publisher parts and functionsLeona Rose Beltran
 
Illustrator assignment 1
Illustrator assignment 1Illustrator assignment 1
Illustrator assignment 1rgosselin
 
Microsoft Publisher 2013 Quickstart
Microsoft Publisher 2013 QuickstartMicrosoft Publisher 2013 Quickstart
Microsoft Publisher 2013 Quickstartcomatsg
 
Loyalty Stamp Tutorial
Loyalty Stamp TutorialLoyalty Stamp Tutorial
Loyalty Stamp TutorialMy App Editor
 
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
 
Microsoft® project painting exercise cpmgt303 version 111
Microsoft® project painting exercise cpmgt303 version 111Microsoft® project painting exercise cpmgt303 version 111
Microsoft® project painting exercise cpmgt303 version 111amit657720
 
Adobe Photoshop I Primer
Adobe Photoshop I PrimerAdobe Photoshop I Primer
Adobe Photoshop I PrimerNYCCTfab
 

Mais procurados (14)

Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7
 
Intro html
Intro htmlIntro html
Intro html
 
Publisher 2007
Publisher 2007Publisher 2007
Publisher 2007
 
Adobe pagemaker
Adobe pagemakerAdobe pagemaker
Adobe pagemaker
 
The Objects Toolbar in MS Publisher
The Objects Toolbar in MS PublisherThe Objects Toolbar in MS Publisher
The Objects Toolbar in MS Publisher
 
Ms publisher parts and functions
Ms publisher parts and functionsMs publisher parts and functions
Ms publisher parts and functions
 
Illustrator assignment 1
Illustrator assignment 1Illustrator assignment 1
Illustrator assignment 1
 
MS PUBLISHER 2007
MS PUBLISHER 2007MS PUBLISHER 2007
MS PUBLISHER 2007
 
Coupons Tutorial
Coupons TutorialCoupons Tutorial
Coupons Tutorial
 
Microsoft Publisher 2013 Quickstart
Microsoft Publisher 2013 QuickstartMicrosoft Publisher 2013 Quickstart
Microsoft Publisher 2013 Quickstart
 
Loyalty Stamp Tutorial
Loyalty Stamp TutorialLoyalty Stamp Tutorial
Loyalty Stamp Tutorial
 
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
 
Microsoft® project painting exercise cpmgt303 version 111
Microsoft® project painting exercise cpmgt303 version 111Microsoft® project painting exercise cpmgt303 version 111
Microsoft® project painting exercise cpmgt303 version 111
 
Adobe Photoshop I Primer
Adobe Photoshop I PrimerAdobe Photoshop I Primer
Adobe Photoshop I Primer
 

Destaque

technology and livelihood education
technology and livelihood educationtechnology and livelihood education
technology and livelihood educationMarivic35
 
Field Study 3 Episode 5
Field Study 3 Episode 5Field Study 3 Episode 5
Field Study 3 Episode 5Jundel Deliman
 
Fs3 episode 6- sarah jane cabilino
Fs3 episode 6- sarah jane cabilinoFs3 episode 6- sarah jane cabilino
Fs3 episode 6- sarah jane cabilinoSarah Cabilino
 
Module 6.9 tle
Module 6.9 tleModule 6.9 tle
Module 6.9 tleNoel Tan
 
K to 12 caregiving learning modules
K to 12 caregiving learning modulesK to 12 caregiving learning modules
K to 12 caregiving learning modulesNoel Tan
 

Destaque (8)

technology and livelihood education
technology and livelihood educationtechnology and livelihood education
technology and livelihood education
 
Japanese literature
Japanese literatureJapanese literature
Japanese literature
 
Field Study 3 Episode 5
Field Study 3 Episode 5Field Study 3 Episode 5
Field Study 3 Episode 5
 
Fs3 episode 6- sarah jane cabilino
Fs3 episode 6- sarah jane cabilinoFs3 episode 6- sarah jane cabilino
Fs3 episode 6- sarah jane cabilino
 
Module 6.9 tle
Module 6.9 tleModule 6.9 tle
Module 6.9 tle
 
K to 12 TLE Curriculum Guide
K to 12 TLE Curriculum GuideK to 12 TLE Curriculum Guide
K to 12 TLE Curriculum Guide
 
K to 12 caregiving learning modules
K to 12 caregiving learning modulesK to 12 caregiving learning modules
K to 12 caregiving learning modules
 
K to 12 Crop Production Learning Modules
K to 12 Crop Production Learning ModulesK to 12 Crop Production Learning Modules
K to 12 Crop Production Learning Modules
 

Semelhante a Technology and Livelihood Education IV

Visual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th classVisual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th classmnewg218
 
VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and eventsPrachi Sasankar
 
personalization
personalizationpersonalization
personalizationsanodia77
 
Lab 2: Optional: Creating requirements information
Lab 2: Optional: Creating requirements informationLab 2: Optional: Creating requirements information
Lab 2: Optional: Creating requirements informationIBM Rational software
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual BasicSangeetha Sg
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.pptLalRatan
 
Chapter 1
Chapter 1Chapter 1
Chapter 1gebrsh
 
The visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowThe visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowTan Ps
 
06 win forms
06 win forms06 win forms
06 win formsmrjw
 
Rational Publishing Engine with Rational DOORS
Rational Publishing Engine with Rational DOORSRational Publishing Engine with Rational DOORS
Rational Publishing Engine with Rational DOORSGEBS Reporting
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic conceptsmelody77776
 
Personalize the forms how to oracle applications release 11.5.10 a technica...
Personalize the forms   how to oracle applications release 11.5.10 a technica...Personalize the forms   how to oracle applications release 11.5.10 a technica...
Personalize the forms how to oracle applications release 11.5.10 a technica...FITSFSd
 

Semelhante a Technology and Livelihood Education IV (20)

Visual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th classVisual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th class
 
VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and events
 
personalization
personalizationpersonalization
personalization
 
Ch01
Ch01Ch01
Ch01
 
Visual C# 2010
Visual C# 2010Visual C# 2010
Visual C# 2010
 
Lab 2: Optional: Creating requirements information
Lab 2: Optional: Creating requirements informationLab 2: Optional: Creating requirements information
Lab 2: Optional: Creating requirements information
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual Basic
 
Introduction to computing
Introduction to computingIntroduction to computing
Introduction to computing
 
unit 4.docx
unit 4.docxunit 4.docx
unit 4.docx
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.ppt
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
The visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowThe visual studio start page is shown in the figure below
The visual studio start page is shown in the figure below
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 
06 win forms
06 win forms06 win forms
06 win forms
 
Rational Publishing Engine with Rational DOORS
Rational Publishing Engine with Rational DOORSRational Publishing Engine with Rational DOORS
Rational Publishing Engine with Rational DOORS
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic concepts
 
Personalize the forms how to oracle applications release 11.5.10 a technica...
Personalize the forms   how to oracle applications release 11.5.10 a technica...Personalize the forms   how to oracle applications release 11.5.10 a technica...
Personalize the forms how to oracle applications release 11.5.10 a technica...
 
Oracle 11i forms personalization
Oracle 11i forms personalizationOracle 11i forms personalization
Oracle 11i forms personalization
 

Último

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 

Último (20)

LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 

Technology and Livelihood Education IV

  • 1.
  • 2. OBJECTIVES •Understand what is an object •Learn the properties, methods and events that correspond with an object •Learn the use of the Properties Window
  • 3. Everything in Visual Basic revolves around what is called as OBJECTS. Objects are a distinct unit in a program that has a certain characteristics and can perform certain actions.
  • 4.
  • 5. Objects have PROPERTIES, just like a real-world object, properties determines what physical appearance your object will look like. You can change the different properties of each objects. ObjectName.Property=Value Object Name = Name of the object with the properties to change Property = attribute you want to change Value = New data of the property
  • 7. • You can also change the Property of an object at design time by using the Properties Window in Visual Basic.
  • 8. Objects can also perform functions of their own. The whole point of creating objects is that objects does something useful. This additional functions are known as METHODS. This allows the objects to perform certain actions. ObjectName.Method Value Object Name = Name of the object with the properties to change Method = action to perform Value = Optional parameters or data you can add
  • 10. To add data to a ComboBox we can use the methods optional parameter Combo1.AddItem “IV-Malory”
  • 11. The form is the basic repository for all you controls, this is were you add all those controls when you design the user interface. A program can have one or more forms. The form that first appear when you run you program is called the startup form. You can change the order of the startup of each form by: 1. Clicking Project from the menu bar 2. Select Project1 Properties 3. The Project Properties will appear 4. Click the Startup Object combo box 5. Select from the list of forms 6. Then click the OK button
  • 12. Each form and control has properties assigned to it by default when you start up a new project. There are two ways to display the properties of an object. The first way is to click on the object (form or control) in the form window. Then, click on the Properties Window or the Properties Window button in the tool bar. The second way is to first click on the Properties Window. The select the object from the Object box in the Properties Window. Properties can be viewed in two ways: • Alphabetic • Categorized
  • 13.  Each object has a set of attributes, called properties, that determine its appearance and behavior  The Properties window exposes the object’s properties to the programmer  The Properties window includes an Object box and a Properties list  The Properties window can be used to change a property of an object
  • 14. Properties window showing the properties of the Form1.vb file object
  • 15.  The Windows Form object has a set of properties  Properties of the Windows Form object will appear in the Properties window when you select the Windows Form object in the designer window
  • 16. Important properties of the Windows Form object:  Name property  Text property  StartPosition property  Size property  BackgroundImage property
  • 17. You can also set or modify properties while your application is running . To do this, you must write some code. The code format is: ObjectName.Property = NewValue Such a format is referred to as dot notation. For example, to change the BackColor property of a form name Form1, we’d type: Form1.BackColor = vbBlue
  • 18. The names you assign to objects are used by Visual Basic to set up a framework of event-driven procedures for you to add code to. The format for each of these subroutines (all object procedures in VB are subroutines) is: Sub ObjectName_Event (Optional Arguments) End Sub VB provides the Sub line with its arguments (if any) and the End Sub statement. You provide any needed code.
  • 19. Several form events will fire starting with the moment of creation. Each has its own purpose and triggers in a certain order. When the Form is first created, an initialize event will occur, followed by Load, Resize, and Paint. 1. Start VB and create a new project 2. Double-click the form 3. The Code Window will appear, by default you’ll be in the Load event procedure, click on the events combo box, scroll through and select the Click event. 4. You’ll now have two event procedure (Load and Click) 5. Click inside the Form_Click event and type the following statement 6. Your code window should look like the one in the next slide.
  • 20. Private Sub Form_Click() Msg “Welcome to Malory” End Sub
  • 21. Properties Description Caption Changes the caption of the title bar in the form Window. Appearance Changes the 3D or Flat appearance of the form BackColor Changes the form background color Font Changes the Font style of the form Enable Sets True of False boolean data, disables and enable the form Picture Puts a picture on the form Visible Hide or unhide the form by setting it True or False ForeColor Changes the color of the text
  • 22. Events Description Load Triggers once the program starts Unload Triggers once the program exits Activate Triggers once the form is active Click Triggers once the form is click Double Click Triggers once the form is double click Terminate Like Initialize, this event will only occur during the existing of the Form. It won’t fire if the program is terminated abnormally Initialize This event occurs only once when the Form is created. It will not fire again unless the Form is Unloaded and Loaded again
  • 23. Methods Description Hide Hides the active form Unhide Unhide the active form Print Use to print text on the form Cls Clear any picture on the form