Anda di halaman 1dari 10

Luke Barnes

Student I.D: S0510054

Page | 1

Assignment 2 Guide to Visual Studios

Wednesday, 28 September 2011

Unit 6 & 15 Object Oriented Programming

Luke Barnes

Student I.D: S0510054

Step 1 Opening the Program


Before anything else the user must open the program in the screenshot found below we see that this is done by simply double clicking the Visual Studios Icon or by highlighting it and pressing the Enter key. Page | 2

Step 2 Creating a Form


a) Once Visual Studios is open the user will be presented with a start page. Select New Project on the left hand side to begin.

b) Click OK to select the already highlighted Windows Form Application

Wednesday, 28 September 2011

Unit 6 & 15 Object Oriented Programming

Luke Barnes

Student I.D: S0510054

Page | 3

c) The user will now be presented with a blank form. Before creating can get underway the user must first select the toolbox and pin it to the screen. To open the toolbox click Here

To pin the toolbox to the screen click Here

Wednesday, 28 September 2011

Unit 6 & 15 Object Oriented Programming

Luke Barnes

Student I.D: S0510054

d) With the Form open the user can now begin to design a program / application. To do this they must choose which controls they wish to use such as... Button Page | 4

Label

Text Box

To add these controls to the text box the User simply clicks and drags the desired control icon to the form wherever they wish.
Drag and drop of button from toolbox to form (left to right)

Wednesday, 28 September 2011

Unit 6 & 15 Object Oriented Programming

Luke Barnes

Student I.D: S0510054

Page | 5

a) With the controls in place the user can begin to alter settings such as font size, title and text. To do this click on the control that requires alteration, and then click on the properties bar found in the bottom right hand corner.

For example to change the text here, click Button1 and type in the desired text. This will then appear on the button. A good example of this in action would be a Translate! button found on a translation program.
Selected button (above) Properties (left) Renamed button (below)

To change the size of a control (such as a label) would be slightly different. To do this a user would again select the control in question (for this example a Label) and select Font and click on the small box with three dots in

Wednesday, 28 September 2011

Unit 6 & 15 Object Oriented Programming

Luke Barnes

Student I.D: S0510054

it. A pop up window would then appear allowing to change text size, font and colour etc. This will result, (if text size is changed) in a bigger/smaller Label.

Page | 6

Original font size (left +above) Font button (right) Font control (below) Resized Label (bottom right)

b) To rename controls is very similar to altering the text found in a Button or Label. Simply select the control in question and click name in the properties menu and enter a new name (However this will require the new name to be entered when coding a program).

Wednesday, 28 September 2011

Unit 6 & 15 Object Oriented Programming

Luke Barnes

Student I.D: S0510054

Original Label name and form (right and above) Renamed Label (below)

Page | 7

Step 3 - How to save


To save a project select file in the top left hand corner, then save all and select the desired save location and click save

Wednesday, 28 September 2011

Unit 6 & 15 Object Oriented Programming

Luke Barnes

Student I.D: S0510054

Converting from one data type to another using CType


Page | 8 To convert data types the user must make use of CType. An example of this is shown to the left.

ToString
To use ToString the code is displaying to the user information to the user through things such as message boxes, labels etc.

Wednesday, 28 September 2011

Unit 6 & 15 Object Oriented Programming

Luke Barnes

Student I.D: S0510054

Using the randomize function means that a random number will be set between a range determined by the user such as 1-10 Page | 9

How to add to a combo box using WITH


To add items to a combo box first drag a combo box onto your form. After this double click the combo box and input the desired information followed by End With

Wednesday, 28 September 2011

Unit 6 & 15 Object Oriented Programming

Luke Barnes

Student I.D: S0510054

Page | 10

Scope
Scope means the amount of access that is available to either the program or certain parts of the program. There are various types of scope three of which are: Private: This means that only selected code is able to access the private code Public: this means that it is open to any piece of code that needs to access it Protected: this means exactly what it says. For example a child class would be protected as the data would be restricted to only certain classes.

Benefits of application interface creation


The benefit of the application interface creation in VB is that it makes the design stage of creating a program much more manageable. For instance it is very easy for a programmer to create a form just how they want it as they can choose background colours, insert images and even resize buttons and labels. Another advantage is that simply double clicking a button or other interactive icon and another window with the control code already present appears. This has the added advantage of saving time, preventing human error (as the code is fairly complex) and being well ordered.

Wednesday, 28 September 2011

Unit 6 & 15 Object Oriented Programming