Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 32

CHAPTER 7

INTRODUCTION TO VISUAL STUDIO


VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
VISUAL STUDIO
Menu Bar and Toolbar - Commands for managing the IDE and for developing, maintaining and
executing apps are contained in menus, which are located on the menu bar of the IDE • The set of
menus displayed depends on what you’re currently doing in the IDE.

Tool Box - You can scroll to view more controls. To sort the tools in the toolbox: • Right-click the
toolbox and select. • Sort Items Alphabetically from the context menu (shortcut menu).

Properties Window - To display the Properties window, select VIEW > Properties Window. • The
Properties window displays the properties for the currently selected Form, control or file in Design
view. • Properties specify information about the Form or control, such as its size, color and position.

Using Help Context-Sensitive Help Visual Studio provides context-sensitive help pertaining to the
“current content” (that is, the items around the location of the mouse cursor). To use context-
sensitive help, click an item, then press the F1 key. The help documentation is displayed in a web
browser window. To return to the IDE, either close the browser window or select the IDE’s icon in
your Windows task bar. You can view this help by selecting the Form, clicking its Text property in
the Properties window and pressing the F1 key.
VISUAL STUDIO
Text Box - Allows for user input • Text property • What is displayed in text box • What user
entered in text box • TextAlign property • Controls alignment of text in the text box

Group Box - Used as a container for other controls such as radio buttons and check boxes •
Improves readability of form by separating the controls into logical groups • Example Names
for Group Boxes • ColorGroupBox • StyleGroupBox

Check Box - Allows the user to select or deselect one or more items in any group • Checked
property • Checked = True • Unchecked = False • Use the Text property for the text you want
to appear next to the box. • Example names for Check Boxes • BoldCheckBox •
ItalicCheckBox

Radio Button - User may select only one in any group. First create a group box and then
create each radio button inside the group box. Checked property Selected = True
Unselected = False Text property What is displayed next to the radio button Example Names
for Radio Buttons RedRadioButton BlueRadioButton.
VISUAL STUDIO
Picture Box - Displays/contains an image Image property Complete path and filename of graphic; it’s a
good idea to place the graphic into the folder with your project before it is assigned to a picture box. Can
set extension to .bmp, .gif, .jpg, .jpeg, .png, .ico, .emf, .wmf PictureBox controls have several useful
properties such as the SizeMode property. StretchImage causes picture to be resized to match the size of
the control, or the Visible property, which can be set to False to make the picture disappear.

Naming Rules and Conventions - Have a set of standards and always follow them. • No spaces,
punctuation marks, or reserved words • Use Pascal casing. • Examples • MessageLabel • ExitButton •
DataEntryForm • PaymentAmountTextBox

Recommended Naming Conventions for VB Objects

Modes - Design Time — used when designing the user interface and writing code • Run Time — used
when testing and running a project • Break Time — if/when receiving a run-time error or pause error

Planning the Project - Design the user interface. • Set up the form. • Resize the form. • Place a label and a
button control on the form using the toolbox. • Lock the Controls in place. • After the user interface is
designed, the next step is to set the properties.
VISUAL STUDIO

Setting the Form Properties - The default startup object is Form1 • The name of the form should always
be changed to adhere to naming rules • The properties window shows the files properties

Setting Properties - Label 1 Name MessageLabel Text leave blank • Button 1 Name PushButton Text
Push Me • Button 2 Name ExitButton Text Exit • Form Name HelloForm Text Hello World by your name

Setting the Tab Order of Controls (1 of 2) - One control on a Form always has the focus. • Not all control
types can receive the focus. • Text boxes, buttons — focus • Picture boxes and labels — no focus •
TabStop property is applicable only for controls that are capable of receiving the focus. • Designates
whether a control is allowed to receive the focus; set to True or False • TabIndex property determines the
order the focus moves as the Tab key is pressed.
VISUAL STUDIO
Lesson 00.3 – The parts of Visual Studio
Before you start using Visual Studio, you should get familiar with the different parts of it.
Here is what Visual Studio will look like after you start building your apps..

Menu
Just like many programs, the menu options are at the top. The ones you’ll use most often are:

File – To open your solution, and start working on it.


Save – Save the current file you’re working on.
Save All – Save all changes in the current solution you’re working on.
Build – This “compiles” your solution – converts it from C# code to code that the computer can understand.
This will also tell you if there are any problems in your solution.
Start – This builds (compiles) your program and runs it – so you can actually use it.
VISUAL STUDIO
Solution Explorer

This section shows all the projects in your solution and all the files in the projects.
This is where you will add files to your projects, rename or move existing files,
and (sometimes) delete files from your project.
1.The SuperAdventure Solution – The top level grouping of your
program/application.
2.Engine project – Where we will put the “logic” of the program.
3.SuperAdventure project – Where we will put the screen/display part of the
program.
VISUAL STUDIO
VISUAL STUDIO

Properties

When you’re working with the parts of the game that appear on the screen –
from the main form to the individual buttons and boxes on it – the Properties
section will show you things you change about your currently selected object.

For instance, you can set the height and width of a form. You can set the
words you want displayed on a button. You can set whether or not something
is visible.

We’ll set some properties for the objects we create from this section of Visual
Studio. Some others will be set from other places inside the program.
VISUAL STUDIO
VISUAL STUDIO
Output
When you build, or run, your program, this is where you’ll receive status messages.
If everything is OK, you see that everything succeeded. If there were any problems, you’ll see where
they are, so you can go fix them.
VISUAL STUDIO

Toolbox
Just like the “Properties” section, the Toolbox area is
filled when you’re currently working on the parts of
your program that are displayed on the screen.
This section shows you all the things you can add to
the forms in your program – buttons, labels (text),
checkboxes, radio buttons, etc. You can select what
you want to add to the form and drag it to the place
where you want it located on your form. You might
hear this called “drag-and-drop” programming.
VISUAL STUDIO
Workspace

This is the space where you actually work on a part of your program.

You select what you want to work on, from the Solution Explorer, and work on it here. You can have
several files open on your workspace at one time (see the tabs at the top of the workspace), but you’ll only
have one “on top”, that you’re actually working on at the moment.

You might also like