Presentation is loading. Please wait.

Presentation is loading. Please wait.

Visual Studio.

Similar presentations


Presentation on theme: "Visual Studio."— Presentation transcript:

1 Visual Studio

2 Introduction Visual Studio is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging apps (also called applications) written in various .NET programming languages. Multiple-project solutions are for large-scale apps. Most apps we create consist of a solution containing a single project.

3 Overview of the Visual Studio IDE
A Windows Forms app executes within a Windows operating system (such as Windows 7, Windows 8, and Windows 10) and typically has a graphical user interface (GUI)—users interact with this visual part of the app. Windows apps include Microsoft software products like Microsoft Word, Internet Explorer and Visual Studio; software products created by other vendors; and customized software that you and other app developers create.

4 Visual Studio Environment
The Visual Studio environment is where you create and test your projects. In Visual Studio, it is called an Integrated Development Environment (IDE) consisting of various tools including: Form Designer Editor for entering and modifying code Compiler Debugger Object Browser Help Facility

5 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.

6 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). When you open the Visual Studio IDE, you generally see an empty environment with a Start Page.

7 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.

8 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.

9 Text Box Allows for user input Text property TextAlign property
What is displayed in text box What user entered in text box TextAlign property Controls alignment of text in the text box

10 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

11 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

12 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

13 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

14 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 Using good consistent names for objects can make a project easier to read and understand, as well as easier to debug. When you select a name for an object, Visual Basic requires the name to begin with a letter or an underscore; names can contain letters, digits, and underscores but no spaces, punctuation marks, or reserved words such as Exit or It. Pascal casing is beginning the name with an uppercase character and capitalizing each additional word in the name.

15 Recommended Naming Conventions for VB Objects
Object Class Example Form DataEntryForm Button ExitButton Label TotalLabel TextBox PaymentAmountTextbox Radio button BoldRadiobutton CheckBox PrintSummaryCheckBox PictureBox LandscapePictureBox ComboBox BookListComboBox ListBox IngredientsListBox

16 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 The Title Bar indicates which mode is currently being used.

17

18

19 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. Design the user interface by making a sketch of the form that includes the controls. Resize the form in the document window; drag the handle (key term) in the lower-right corner. Place the controls by pointing to the tool in the toolbox and clicking to select; drag the pointer over the form and the pointer becomes a crosshair; point to a spot to place the corner of the control and drag to create the control; a selected control that is selected will have 8 small square handles around it (Button 2). Once the controls have been selected and placed on the form, right-click on one of the controls and select Lock Controls from the context menu.

20 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 Using good consistent names for objects can make a project easier to read and understand, as well as easier to debug. When you select a name for an object, Visual Basic requires the name to begin with a letter or an underscore; names can contain letters, digits, and underscores but no spaces, punctuation marks, or reserved words such as Exit or It. Pascal casing is beginning the name with an uppercase character and capitalizing each additional word in the name.

21 Setting Properties Label 1 Button 1 Button 2 Form 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 Design the user interface by making a sketch of the form that includes the controls. Resize the form in the document window; drag the handle (key term) in the lower-right corner. Place the controls by pointing to the tool in the toolbox and clicking to select; drag the pointer over the form and the pointer becomes a crosshair; point to a spot to place the corner of the control and drag to create the control; a selected control that is selected will have 8 small square handles around it (Button 2). Once the controls have been selected and placed on the form, right-click on one of the controls and select Lock Controls from the context menu.

22 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.

23 Setting the Tab Order of Controls (2 of 2)


Download ppt "Visual Studio."

Similar presentations


Ads by Google