SlideShare una empresa de Scribd logo
1 de 33
VISUAL BASIC
STARTING A NEW PROJECT
THE PROPERTIES WINDOW
COMMON FORM PROPERTIES
SCALE PROPERTIES
COLOR PROPERTIES
THE TOOLBOX
CREATING CONTROL
THE NAME PROPERTY
PROPERTIES OF COMMAND BUTTONS
SIMPLE EVENT PROCEDURE FOR COMMAND BUTTONS
ACCESS KEY
IMAGE CONTROL
TEXTBOX,LABELS,MESSAGE BOX
GRID
VISUAL BASIC
Visual Basic is a event-driven programming Language from Microsoft known for
its Component Object Model (COM) programming.
Visual Basic was derived from BASIC and enables the rapid application development
(RAD) of graphical user interface (GUI) applications, access to databases using Data
Access Objects, Remote Data Objects or ActiveX Data Objects
A programmer can create an application using the components provided by the Visual
Basic program itself.
STARTING A NEW PROJECT
Create a project
There are multiple ways to create a new project in Visual Studio 2019. When
you first open Visual Studio, the start window appears, and from there, you can
choose Create a new project.
• Open Visual Studio 2019.
• On the start window, choose Create a new project.
If the Visual Studio development environment is already open, you can create a new
project by choosing File > New > Project on the menu bar or by clicking the New
Project button on the toolbar.
FROM THE TOOLS BOX, DRAG A PICTURE BOX ONTO YOUR FORM, DRAG A BUTTON
ONTO YOUR FORM AND DRAG AN OPEN FILE DIALOG ONTO YOUR FORM.
CONTROL PROPERTIES
To edit properties, click on the object and change the values in the properties window.
Form Properties
Text: Picture Viewer
Form Border Style: Fixed Tool Window
Picture Box
Background Image Layout: Zoom
Button
Text: Select Image
ADD CODE
VISUAL BASIC IDE(INTEGRADED
DEVELOPMENT ENVIRONMENT)
The Visual Studio integrated development environment is a creative that you
can use to edit, debug, and build code, and then publish an app.
An integrated development environment (IDE) is a feature-rich program that
can be used for many aspects of software development.
Over and above the standard editor and debugger that most IDEs provide,
Visual Studio includes compilers, code completion tools, graphical designers,
and many more features to ease the software development process.
• Solution Explorer (top right) lets you view, navigate, and manage your code
files. Solution Explorer can help organize your code by grouping the files
into solutions and projects.
• The editor window (center), where you'll likely spend a majority of your
time, displays file contents. This is where you can edit code or design a user
interface such as a window with buttons and text boxes.
• The Output window (bottom center) is where Visual Studio sends
notifications such as debugging and error messages, compiler warnings,
publishing status messages, and more. Each message source has its own
tab.
• Explorer (bottom right) lets you track work and share code with others using
version control technologies.
THE PROPERTIES WINDOW
• The Properties window is used to display properties for objects selected in the two
main types of windows available in the Visual Studio integrated development
environment (IDE). These two types of windows are:
• Tool windows such as Solution Explorer, Class View, and Object browser
• Document windows containing such editors and designers as the forms designer,
XML editor, and HTML editor
Using the Properties Window
• The Properties window displays the properties of single or multiple selected items.
If multiple items are selected, the intersection of all properties for all selected
objects is displayed.
COMMON FORM PROPERTIES
• Name : It sets the name of the control, through which you can access the control’s properties and
methods.
• Appearance : It can be 0 for a flat look or 1 for a 3-D look.
• Back Color : It sets the background color on which text is displayed or graphics are drawn.
• Fore Color : It sets the foreground color
• Font : It sets the face, attribute, and size of the font used for the text on the control.
• Caption : It sets the text that is displayed on many controls that don’t accept input, for example, the text
on a Label control, the caption of a Command Button control.
• Text : It sets the text that is displayed on the controls that accept user input, for example, the TextBox
control.
• Width & Height : These properties set the control’s dimensions.
• Left & Top : These properties set the coordinates of the control’s upper-left corner, expressed in the
units of the container.
• Enabled : By default, this property’s value is True, which means that the control can get the focus.
• Visible : Set this property to False to make a control invisible.
SCALE PROPERTIES
• Width and Height Properties:The Width and Height properties of the Picture Box control are expressed in twips. If you change the
control’s coordinate system, the values of these two properties won’t change. If you resize the control on the Form by dragging
its handles with the mouse, the Width and Height properties will change value to reflect the new size of the control.
• Left “and Top Properties
• The Left and Top properties are the coordinates of the control’s upper-left comer, / and they are expressed in the container’s
coordinate system. If you change their values, the control is repositioned. They also change value if you change the
container’s coordinate system to reflect the control’s position in the new coordinate system.
• ScaleMode Property
• The ScnleMode property sets (or returns) the-control’s current coordinate system.
If you set this property to 0 (User), you must also set the ScaleWidth and ScaleHeight properties.
• ScaleWidth and ScaleHeight Properties
• These two properties are the control’s inner dimensions in units of the current coordinate system. Changing the coordinate system
doesn’tchange the size of the control, but it does change the number of units that can fit along the tW6 axes of the control.
• ScaleLeft and SealeTop Properties
• ScaleLeft and ScaleTop are the coordinates of the upper-left comer of the control in a user-defined system of
coordinates. Coordinate systems need not start at zero. Sca1eLeftis the minimum value an Xcoordinate can assume. The maximum
Xcoordinate is Sca1eLeft+ScaleWidth.
• Scale Method
• Using the Scale method is the most convenient way to set up a user-defined coordinate system.
The.coordinates 0; the upper-left comer of the control are (Xl, V, and (X2, Y2) are the coordinate of the lower-right comer.
COLOR PROPERTIES
properties of a control such as font, location, size, foreground color, background color,
MaximizeBox, MinimizeBox and etc. You can also change the properties of the object
at runtime to give special effects such as change of color, shape, animation effect and
so on
• Forecolor
• Backcolor
• Backgroundimage
• Backgroundcolor
THE TOOLBOX
• The Toolbox contains a set of controls that are used to place on a Form at design
time thereby creating the user interface area. Additional controls can be included in
the toolbox by using the Components menu item on the Project menu.
Control Description
Pointer Provides a way to move and resize the controls form
PictureBox Displays icons/bitmaps and metafiles. It displays text or acts as a visual container for other controls.
TextBox Used to display message and enter text.
Frame Serves as a visual and functional container for controls
CommandButton Used to carry out the specified action when the user chooses it.
CheckBox Displays a True/False or Yes/No option.
OptionButton OptionButton control which is a part of an option group allows the user to select only one option even it displays mulitiple choices.
ListBox Displays a list of items from which a user can select one.
ComboBox Contains a TextBox and a ListBox. This allows the user to select an ietm from the dropdown ListBox, or to type in a selection in the TextBox.
HScrollBar and VScrollBar These controls allow the user to select a value within the specified range of values
Timer Executes the timer events at specified intervals of time
DriveListBox Displays the valid disk drives and allows the user to select one of them.
DirListBox Allows the user to select the directories and paths, which are displayed.
FileListBox Displays a set of files from which a user can select the desired one.
Shape Used to add shape (rectangle, square or circle) to a Form
Line Used to draw straight line to the Form
Image used to display images such as icons, bitmaps and metafiles. But less capability than the PictureBox
Data Enables the use to connect to an existing database and display information from it.
OLE Used to link or embed an object, display and manipulate data from other windows based applications.
Label Displays a text that the user cannot modify or interact with.
CREATING CONTROL AND THE NAME
PROPERTY
• Every control has it’s properties one of the common properties of controls is name
property. Name property is the one by which the control is identified and it is
referred as the object name of that control.
• By using name property programmer can access the other properties of the controls
and methods as well at run time.
•
• Visual Basic gives default name to the controls which can be later changed by
changing it’s name property at the design time or urn time.
PROPERTIES OF COMMAND
BUTTON
• The main function of the CommandButton control is to run code when the user
clicks on it. You should keep the following points in mind when programming with
CommandButton properties:
• You should always change the Caption property of a CommandButton. The Caption
property contains the text displayed on the CommandButton. This property can be
changed at design time and runtime.
• The Cancel property is a Boolean type. It allows VB to associate the Escape key
with the CommandButton's Click event procedure. Thus if you set Cancel to True,
the Click event procedure fires when the user presses the Escape key. Cancel
buttons are usually associated the with the Escape key.
COMMON PROPERTIES OF COMMAND BUTTON
Property Description
Left The position of the left side of a control with respect
to its container
Top The position of the top of a control with respect to
its container
Height A control's height
Width A control's width
Name The string value used to refer to a control
Enabled The Boolean (True/False) value that determines
whether users can manipulate the control
Visible The Boolean (True/False) value that determines
whether users can see the control
COMMON METHODS OF VISUAL
BASIC CONTROLS
Method Use
Move Changes an object's position in response to a
code request
Drag Handles the execution of a drag-and-drop
operation by the user
SetFocus Gives focus to the object specified in the
method call
ZOrder Determines the order in which multiple objects
appear onscreen
COMMON EVENTS OF VISUAL BASIC
CONTROLS
Event Occurrence
Change The user modifies text in a combo box or text box.
Click The user clicks the primary mouse button on an object.
DblClick The user double-clicks the primary mouse button on an object.
DragDrop The user drags an object to another location.
DragOver The user drags an object over another control.
GotFocus An object receives focus.
KeyDown The user presses a keyboard key while an object has focus.
KeyPress The user presses and releases a keyboard key while an object has
focus.
KeyUp The user releases a keyboard key while an object has focus.
Event Occurrence
LostFocus An object loses focus.
MouseDown The user presses any mouse button while the mouse pointer is over an
object.
MouseMove The user moves the mouse pointer over an object.
MouseUp The user releases any mouse button while the mouse pointer is over an
object.
SIMPLE EVENT PROCEDURE FOR
COMMAND BUTTONS
• A procedure contains a series of Visual Basic statements that perform an operation
or calculate a value. An event procedure is a procedure that runs in response to an
event.
To write the event procedure for the OK command button
• 1 In Design view, right-click the object (form, report, section, or control) for which
you want to write an event procedure, in this case, the OK command button. On the
shortcut menu, click Build Event.
• Microsoft Access displays the Choose Builder dialog box.
• 2 In the list box, click Code Builder, and then click OK.
ACCESS KEY
• An access key is an underlined character in the text of a menu, menu item, or the
label of a control such as a button. With an access key, the user can "click" a button
by pressing the Alt key in combination with the predefined access key.
• For example, if a button runs a procedure to print a form, and therefore its property
is set to "Print," adding an ampersand before the letter "P" causes the letter "P" to
be underlined in the button text at run time. The user can run the command
associated with the button by pressing Alt+P.
IMAGE CONTROL
• The PictureBox control is used for displaying images on the form. The Image property of
the control allows you to set an image both at design time or at run time. Let's create a picture box by
dragging a PictureBox control from the Toolbox and dropping it on the form.
• Image
Gets or sets the image that is displayed in the control.
ImageLocation
• Gets or sets the path or the URL for the image displayed in the control.
InitialImage
• Gets or sets the image displayed in the control when the main image is loaded.
SizeMode
• Determines the size of the image to be displayed in the control. This property takes its value from the
PictureBoxSizeMode enumeration, which has values −
• Normal − the upper left corner of the image is placed at upper left part of the picture box
• StrechImage − allows stretching of the image
• AutoSize − allows resizing the picture box to the size of the image
• CenterImage − allows centering the image in the picture box
• Zoom − allows increasing or decreasing the image size to maintain the size ratio.
TEXTBOX,LABELS,MESSAGE BOX
• The Label
• The label can be used to provide instructions and guides to the users as well as to display
outputs. It is different from text box because it can only display static text, which means the user
cannot change the text.
• TextBox
• The TextBox control is for accepting input from the user as well as to display the output. It can
handle string and numeric data but not images or pictures. String in a text box can be converted
to a numeric data by using the function Val(text). The label control is only for displaying a
caption/title or to display an output.
• A message box is a special dialog box used to display a piece of information to the user. As
opposed to a regular form, the user cannot type anything in the dialog box. To support message
boxes, the Visual Basic language provides a function named MsgBox.
• To display a simple message box, you can use the MsgBox() function with the following formula:
GRID
• A grid view or a datagrid is a graphical control element that presents a tabular
view of data.
• Clicking a column header to change the sort order of the grid
• Dragging column headers to change their size and their order
• In-place editing of viewed data
• Row and column separators, and alternating row background colors
Visual basic

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Android animation
Android animationAndroid animation
Android animation
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
JavaScript Control Statements I
JavaScript Control Statements IJavaScript Control Statements I
JavaScript Control Statements I
 
HTML frames and HTML forms
HTML frames and HTML formsHTML frames and HTML forms
HTML frames and HTML forms
 
Html images syntax
Html images syntaxHtml images syntax
Html images syntax
 
Web application
Web applicationWeb application
Web application
 
LINKING IN HTML
LINKING IN HTMLLINKING IN HTML
LINKING IN HTML
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Client side scripting and server side scripting
Client side scripting and server side scriptingClient side scripting and server side scripting
Client side scripting and server side scripting
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
 
Photoshop layers
Photoshop layersPhotoshop layers
Photoshop layers
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
User Interface Design - Module 1 Introduction
User Interface Design - Module 1 IntroductionUser Interface Design - Module 1 Introduction
User Interface Design - Module 1 Introduction
 
GUI components in Java
GUI components in JavaGUI components in Java
GUI components in Java
 
Architecture of .net framework
Architecture of .net frameworkArchitecture of .net framework
Architecture of .net framework
 
Dhtml ppt (2)
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)
 
Animation in the web
Animation in the webAnimation in the web
Animation in the web
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
Html form tag
Html form tagHtml form tag
Html form tag
 

Similar a Visual basic

Similar a Visual basic (20)

Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
Visual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdfVisual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdf
 
Visual C# 2010
Visual C# 2010Visual C# 2010
Visual C# 2010
 
Vb basic
Vb basicVb basic
Vb basic
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
VB6_INTRODUCTION.ppt
VB6_INTRODUCTION.pptVB6_INTRODUCTION.ppt
VB6_INTRODUCTION.ppt
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
 
Visual basic
Visual basicVisual basic
Visual basic
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
Vb basics
Vb basicsVb basics
Vb basics
 
Unit2
Unit2Unit2
Unit2
 
Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
Grasping The LightSwitch Paradigm
Grasping The LightSwitch ParadigmGrasping The LightSwitch Paradigm
Grasping The LightSwitch Paradigm
 
Introduction to Visual Basic (Week 2)
Introduction to Visual Basic (Week 2)Introduction to Visual Basic (Week 2)
Introduction to Visual Basic (Week 2)
 
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdfVB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
 
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdfVB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic concepts
 
CheckBox In C#.pptx
CheckBox In C#.pptxCheckBox In C#.pptx
CheckBox In C#.pptx
 

Último

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Último (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Visual basic

  • 1.
  • 2. VISUAL BASIC STARTING A NEW PROJECT THE PROPERTIES WINDOW COMMON FORM PROPERTIES SCALE PROPERTIES COLOR PROPERTIES THE TOOLBOX CREATING CONTROL THE NAME PROPERTY PROPERTIES OF COMMAND BUTTONS SIMPLE EVENT PROCEDURE FOR COMMAND BUTTONS ACCESS KEY IMAGE CONTROL TEXTBOX,LABELS,MESSAGE BOX GRID
  • 3. VISUAL BASIC Visual Basic is a event-driven programming Language from Microsoft known for its Component Object Model (COM) programming. Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects or ActiveX Data Objects A programmer can create an application using the components provided by the Visual Basic program itself.
  • 4. STARTING A NEW PROJECT Create a project There are multiple ways to create a new project in Visual Studio 2019. When you first open Visual Studio, the start window appears, and from there, you can choose Create a new project. • Open Visual Studio 2019. • On the start window, choose Create a new project. If the Visual Studio development environment is already open, you can create a new project by choosing File > New > Project on the menu bar or by clicking the New Project button on the toolbar.
  • 5.
  • 6. FROM THE TOOLS BOX, DRAG A PICTURE BOX ONTO YOUR FORM, DRAG A BUTTON ONTO YOUR FORM AND DRAG AN OPEN FILE DIALOG ONTO YOUR FORM.
  • 8. To edit properties, click on the object and change the values in the properties window. Form Properties Text: Picture Viewer Form Border Style: Fixed Tool Window Picture Box Background Image Layout: Zoom Button Text: Select Image
  • 10. VISUAL BASIC IDE(INTEGRADED DEVELOPMENT ENVIRONMENT) The Visual Studio integrated development environment is a creative that you can use to edit, debug, and build code, and then publish an app. An integrated development environment (IDE) is a feature-rich program that can be used for many aspects of software development. Over and above the standard editor and debugger that most IDEs provide, Visual Studio includes compilers, code completion tools, graphical designers, and many more features to ease the software development process.
  • 11.
  • 12. • Solution Explorer (top right) lets you view, navigate, and manage your code files. Solution Explorer can help organize your code by grouping the files into solutions and projects. • The editor window (center), where you'll likely spend a majority of your time, displays file contents. This is where you can edit code or design a user interface such as a window with buttons and text boxes. • The Output window (bottom center) is where Visual Studio sends notifications such as debugging and error messages, compiler warnings, publishing status messages, and more. Each message source has its own tab. • Explorer (bottom right) lets you track work and share code with others using version control technologies.
  • 13. THE PROPERTIES WINDOW • The Properties window is used to display properties for objects selected in the two main types of windows available in the Visual Studio integrated development environment (IDE). These two types of windows are: • Tool windows such as Solution Explorer, Class View, and Object browser • Document windows containing such editors and designers as the forms designer, XML editor, and HTML editor Using the Properties Window • The Properties window displays the properties of single or multiple selected items. If multiple items are selected, the intersection of all properties for all selected objects is displayed.
  • 14. COMMON FORM PROPERTIES • Name : It sets the name of the control, through which you can access the control’s properties and methods. • Appearance : It can be 0 for a flat look or 1 for a 3-D look. • Back Color : It sets the background color on which text is displayed or graphics are drawn. • Fore Color : It sets the foreground color • Font : It sets the face, attribute, and size of the font used for the text on the control. • Caption : It sets the text that is displayed on many controls that don’t accept input, for example, the text on a Label control, the caption of a Command Button control. • Text : It sets the text that is displayed on the controls that accept user input, for example, the TextBox control. • Width & Height : These properties set the control’s dimensions. • Left & Top : These properties set the coordinates of the control’s upper-left corner, expressed in the units of the container. • Enabled : By default, this property’s value is True, which means that the control can get the focus. • Visible : Set this property to False to make a control invisible.
  • 15. SCALE PROPERTIES • Width and Height Properties:The Width and Height properties of the Picture Box control are expressed in twips. If you change the control’s coordinate system, the values of these two properties won’t change. If you resize the control on the Form by dragging its handles with the mouse, the Width and Height properties will change value to reflect the new size of the control. • Left “and Top Properties • The Left and Top properties are the coordinates of the control’s upper-left comer, / and they are expressed in the container’s coordinate system. If you change their values, the control is repositioned. They also change value if you change the container’s coordinate system to reflect the control’s position in the new coordinate system. • ScaleMode Property • The ScnleMode property sets (or returns) the-control’s current coordinate system. If you set this property to 0 (User), you must also set the ScaleWidth and ScaleHeight properties. • ScaleWidth and ScaleHeight Properties • These two properties are the control’s inner dimensions in units of the current coordinate system. Changing the coordinate system doesn’tchange the size of the control, but it does change the number of units that can fit along the tW6 axes of the control. • ScaleLeft and SealeTop Properties • ScaleLeft and ScaleTop are the coordinates of the upper-left comer of the control in a user-defined system of coordinates. Coordinate systems need not start at zero. Sca1eLeftis the minimum value an Xcoordinate can assume. The maximum Xcoordinate is Sca1eLeft+ScaleWidth. • Scale Method • Using the Scale method is the most convenient way to set up a user-defined coordinate system. The.coordinates 0; the upper-left comer of the control are (Xl, V, and (X2, Y2) are the coordinate of the lower-right comer.
  • 16. COLOR PROPERTIES properties of a control such as font, location, size, foreground color, background color, MaximizeBox, MinimizeBox and etc. You can also change the properties of the object at runtime to give special effects such as change of color, shape, animation effect and so on • Forecolor • Backcolor • Backgroundimage • Backgroundcolor
  • 17.
  • 18. THE TOOLBOX • The Toolbox contains a set of controls that are used to place on a Form at design time thereby creating the user interface area. Additional controls can be included in the toolbox by using the Components menu item on the Project menu. Control Description Pointer Provides a way to move and resize the controls form PictureBox Displays icons/bitmaps and metafiles. It displays text or acts as a visual container for other controls. TextBox Used to display message and enter text. Frame Serves as a visual and functional container for controls CommandButton Used to carry out the specified action when the user chooses it. CheckBox Displays a True/False or Yes/No option. OptionButton OptionButton control which is a part of an option group allows the user to select only one option even it displays mulitiple choices. ListBox Displays a list of items from which a user can select one. ComboBox Contains a TextBox and a ListBox. This allows the user to select an ietm from the dropdown ListBox, or to type in a selection in the TextBox. HScrollBar and VScrollBar These controls allow the user to select a value within the specified range of values Timer Executes the timer events at specified intervals of time DriveListBox Displays the valid disk drives and allows the user to select one of them. DirListBox Allows the user to select the directories and paths, which are displayed. FileListBox Displays a set of files from which a user can select the desired one. Shape Used to add shape (rectangle, square or circle) to a Form Line Used to draw straight line to the Form Image used to display images such as icons, bitmaps and metafiles. But less capability than the PictureBox Data Enables the use to connect to an existing database and display information from it. OLE Used to link or embed an object, display and manipulate data from other windows based applications. Label Displays a text that the user cannot modify or interact with.
  • 19.
  • 20. CREATING CONTROL AND THE NAME PROPERTY • Every control has it’s properties one of the common properties of controls is name property. Name property is the one by which the control is identified and it is referred as the object name of that control. • By using name property programmer can access the other properties of the controls and methods as well at run time. • • Visual Basic gives default name to the controls which can be later changed by changing it’s name property at the design time or urn time.
  • 21. PROPERTIES OF COMMAND BUTTON • The main function of the CommandButton control is to run code when the user clicks on it. You should keep the following points in mind when programming with CommandButton properties: • You should always change the Caption property of a CommandButton. The Caption property contains the text displayed on the CommandButton. This property can be changed at design time and runtime. • The Cancel property is a Boolean type. It allows VB to associate the Escape key with the CommandButton's Click event procedure. Thus if you set Cancel to True, the Click event procedure fires when the user presses the Escape key. Cancel buttons are usually associated the with the Escape key.
  • 22. COMMON PROPERTIES OF COMMAND BUTTON Property Description Left The position of the left side of a control with respect to its container Top The position of the top of a control with respect to its container Height A control's height Width A control's width Name The string value used to refer to a control Enabled The Boolean (True/False) value that determines whether users can manipulate the control Visible The Boolean (True/False) value that determines whether users can see the control
  • 23. COMMON METHODS OF VISUAL BASIC CONTROLS Method Use Move Changes an object's position in response to a code request Drag Handles the execution of a drag-and-drop operation by the user SetFocus Gives focus to the object specified in the method call ZOrder Determines the order in which multiple objects appear onscreen
  • 24. COMMON EVENTS OF VISUAL BASIC CONTROLS Event Occurrence Change The user modifies text in a combo box or text box. Click The user clicks the primary mouse button on an object. DblClick The user double-clicks the primary mouse button on an object. DragDrop The user drags an object to another location. DragOver The user drags an object over another control. GotFocus An object receives focus. KeyDown The user presses a keyboard key while an object has focus. KeyPress The user presses and releases a keyboard key while an object has focus. KeyUp The user releases a keyboard key while an object has focus. Event Occurrence LostFocus An object loses focus. MouseDown The user presses any mouse button while the mouse pointer is over an object. MouseMove The user moves the mouse pointer over an object. MouseUp The user releases any mouse button while the mouse pointer is over an object.
  • 25. SIMPLE EVENT PROCEDURE FOR COMMAND BUTTONS • A procedure contains a series of Visual Basic statements that perform an operation or calculate a value. An event procedure is a procedure that runs in response to an event. To write the event procedure for the OK command button • 1 In Design view, right-click the object (form, report, section, or control) for which you want to write an event procedure, in this case, the OK command button. On the shortcut menu, click Build Event. • Microsoft Access displays the Choose Builder dialog box. • 2 In the list box, click Code Builder, and then click OK.
  • 26.
  • 27.
  • 28. ACCESS KEY • An access key is an underlined character in the text of a menu, menu item, or the label of a control such as a button. With an access key, the user can "click" a button by pressing the Alt key in combination with the predefined access key. • For example, if a button runs a procedure to print a form, and therefore its property is set to "Print," adding an ampersand before the letter "P" causes the letter "P" to be underlined in the button text at run time. The user can run the command associated with the button by pressing Alt+P.
  • 29. IMAGE CONTROL • The PictureBox control is used for displaying images on the form. The Image property of the control allows you to set an image both at design time or at run time. Let's create a picture box by dragging a PictureBox control from the Toolbox and dropping it on the form. • Image Gets or sets the image that is displayed in the control. ImageLocation • Gets or sets the path or the URL for the image displayed in the control. InitialImage • Gets or sets the image displayed in the control when the main image is loaded. SizeMode • Determines the size of the image to be displayed in the control. This property takes its value from the PictureBoxSizeMode enumeration, which has values − • Normal − the upper left corner of the image is placed at upper left part of the picture box • StrechImage − allows stretching of the image • AutoSize − allows resizing the picture box to the size of the image • CenterImage − allows centering the image in the picture box • Zoom − allows increasing or decreasing the image size to maintain the size ratio.
  • 30. TEXTBOX,LABELS,MESSAGE BOX • The Label • The label can be used to provide instructions and guides to the users as well as to display outputs. It is different from text box because it can only display static text, which means the user cannot change the text. • TextBox • The TextBox control is for accepting input from the user as well as to display the output. It can handle string and numeric data but not images or pictures. String in a text box can be converted to a numeric data by using the function Val(text). The label control is only for displaying a caption/title or to display an output. • A message box is a special dialog box used to display a piece of information to the user. As opposed to a regular form, the user cannot type anything in the dialog box. To support message boxes, the Visual Basic language provides a function named MsgBox. • To display a simple message box, you can use the MsgBox() function with the following formula:
  • 31.
  • 32. GRID • A grid view or a datagrid is a graphical control element that presents a tabular view of data. • Clicking a column header to change the sort order of the grid • Dragging column headers to change their size and their order • In-place editing of viewed data • Row and column separators, and alternating row background colors