Introduction / Controls & Forms
Subtitles of the Movie
In this movie we will begin by launching Visual Studio 2005. Click Start and then select Microsoft Visual Studio 2005 on your computer. This will take a few seconds to launch. The first screen you will see is known as the start page. In this movie we want to create a simple project with some demonstration controls. So I'll go to the create project link and then that allows the new project dialog box to open. Now once you're at this screen you want to make sure that you're in the Visual Basic environment as opposed to one of the other languages such as Visual C or Visual J. So make sure you're in Visual Basic and also click on the icon that says Windows Application. We also want to create a name for our application which by default is called Windows Application 1, but we'll change this to simple the word Sample for this application and I'll click OK. The first thing you want to do when you open up Visual Basic environment is to organize your IDE. If your toolbox is not visible, click to View and choose Toolbox. This will cause the toolbox to appear and will allow you to select items from the toolbox to place onto the form. The form should be placed in the middle and this is where you will be placing controls and this is Windows application. And on the right hand side you'll see the Properties window. Again, if you do not see the properties window simply click View and choose Properties Window. If you see any other windows that are open at this point, simply close them. For example, if the solution explorer is open simply click the X within that smaller window, take care not to close the entire Visual Studio package but only the window that you wish to close, in this case the solution explorer window. So this is your typical Visual Basic environment. Toolbox on the left, form in the middle, properties window on the right. All these windows actually could be moved around to a different location but this is kind of the standard way that visual programmers set their environment up. Other windows will be needed as our projects become more complex. Let's focus on the toolbox and specifically on the common controls. You'll notice that there are various categories in the toolbox. If you do not see the various categories, you may need to close or open some of those in order to see the various categories within the toolbox. For example, later in this tutorial you might want to open the printing controls or the dialog controls but at this point we can close these because what we want to focus on are the common controls. Once I expose the common controls you'll see I read the long list of controls that you could then implement into your application. For this demonstration I will use two controls, a button and a label. There are two basic ways of placing an object onto a form. One is simply double click and that places the object in the upper left hand corner of the form. Once it's here you can then move it by simply dragging it to another location, you can also resize it by using the sizing handles provided. An alternative way of getting a control onto a form is to select it from the toolbox and simply click once and then drag and draw into the location that you wish for it to appear on the form. Likewise if I double click Label, it appears in the upper left corner of the form. If I select Label and then drag and draw, I could do that as well. Once these objects are on the form, I can move them about to various locations on the form as needed. If you find that you need to delete a control, for example this button. I could simply right click and choose Delete and that will remove it from the form. Another way of deleting a control is to select it and then press the Delete key on the keyboard. If you accidentally delete an object, you can always go to Edit and Undo and it will bring it back. So I could bring back both of these deletions if I so choose. One more quick note before we conclude this movie, you'll notice that every object does have a default name, in this case, Label 1, Label 2, Button 1, and Button 2. Each of these objects can be renamed over in the Properties window. In a later tutorial, we will investigate that and see the importance of naming these controls so that they are meaningful for the programmer.
Tutorial Information
| Course: | Microsoft Visual Basic 2005 |
| Author: | Arthur Lee |
| SKU: | 33940 |
| ISBN: | 1-935320-10-6 |
| Release Date: | 2008-11-19 |
| Duration: | 7.5 hrs / 97 lessons |
| Work Files: |
Yes |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 