A VB 6 form has a title bar and the title of the form can be changed. In this article, we will talk about two ways to change the title of a form object.
- Change title from property window.
- Change title during run-time from code editor.
Change title using property window
When you select a VB 6 from in the IDE. You will notice that on left hand corner window , there is a small section called
Property Window, which shows all the properties of the form object.
We can change the title and some other property of a form easily. This is most preferred way to things in VB 6.
In the above figure, we have used
caption attribute to set the title for the form object. In the same way you can change
Width of the form, set a background color for the form and so on.
Changing title during run-time
You saw how we can change the title and other properties using property window for the form. Now, we will see another method of changing the title for the form –
You can write some code that will change the title and other attributes of a form.For example, consider the following code to change the title to “Finance”.
Private Sub Form_Load() Me.Caption = "Finance" Me.BackColor = RGB(255, 120, 0) End Sub
The above code will two things:
- Change the title to
- Change the background color to
Visual Basic 6 For Dummies 1st Edition
Create your own custom Visual Basic programs fast for Windows 95, Windows 98, and Windows NT!
If you want to develop business applications for Windows, then Microsoft’s Visual Basic 6 programming environment is for you. With its powerful and friendly object-oriented interface, Visual Basic 6 is the ideal tool for creating easy-to-use and attractive interfaces of your own. Whether you want to build original programs from the ground up or take advantage of existing wizards, Visual Basic 6 For Dummies will help you design and debug your work – and accomplish all your goals!
- Covers using Visual Basic 6 with Windows 95, Windows 98, and Windows NT
- Walks you through the ins and outs of object-oriented programming in Visual Basic and using the Visual Basic toolset
- Shows you how to make use of menus and submenus, write subprograms that everyone can share, save and retrieve information in databases, integrate ActiveX controls into your applications, and build attractive user interfaces with buttons, boxes, and scroll bars
From the fundamentals of writing BASIC code to the thrill of distributing your very own custom applications, Visual Basic 6 For Dummies brings a fresh perspective to programming in Visual Basic 6 that everyone can understand.