COS120 LECTURE 2 - COS120 Chapter 3.1-3.2 VB Controls and...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 COS120 Chapter 3.1-3.2 VB Controls and Events Creating a New VB Program: 1. Load VB and choose New Project . Select Windows Application and give a name and location to the project. The name chosen will be the name of a new folder in which all the files related to the project will be stored. Pay attention to the name and location of your project. Use clear project names; default names like WindowsApplication are not very useful.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 A new empty VB project appears on the screen. The project currently contains one empty form. If the Toolbox hides, press the Push Pin to fix it on the left side. VB Programming Environment: Toolbox Icons for common Windows objects Solution Explorer Window The hierarchy of folders and files that make up the project Properties Window A property list for the selected object Any of the windows can be closed, moved, or sized to suit you. Use the View menu command to open/close a window manually. The Form Object: The VB project currently contains one form upon which you will add controls such as text boxes, labels, command buttons, etc. The default name for this form file is Form1.vb as can be seen in the Solution Explorer Folder . Toolbox Solution Explorer Window Property Window
Background image of page 2
3 When a VB application is created, several folders and files are made to support the project. Note the appearance of the folder structure. It is best to leave the files alone as moving, deleting, or renaming them may cause the application to fail. An object is selected by clicking it. Once the square handles appear, the object can be moved, sized, or deleted. The size set for the form at design time will be its size when loaded by the user. It is easier to manipulate the form if you do not maximize it or make it excessively large at this point. Each object has a set of properties that can be set at design time or altered during run-time . Properties can be viewed either alphabetically or by category. The Properties Window changes to reflect choices for the selected object.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 The VB Toolbox: The Toolbox displaying on the left side of the screen contains many predesigned Windows controls that you may add to your VB application. Most of these are part of the Windows operating system and were already stored on your hard disk. In more advanced VB work you would learn to add more controls from either third-party sources or design your own. The Label Control:
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

COS120 LECTURE 2 - COS120 Chapter 3.1-3.2 VB Controls and...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online