Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 300,143 times

Contents

Related Categories

Visual Basic Tutorial - Properties

Properties

Now that you have added the Label to your form, and selected it, you can change its properties using the properties window:


Figure 1 - The Properties Window

This window lists lots of different properties that you can use to change how a control looks and behaves. For example, the Appearance property sets whether a control should look 'Flat' or 3D. For the moment, you don't need to worry about these, but you can come back later and work out what they do. If at any stage you're not sure, simply press F1, and the VB help file will appear.

First, we need to give the control a meaningful name. This is so that when we start writing code, we can refer to this control, and remember which it is. The current name of 'Label1' is not particularly helpful. To change the name, we modify the text next to the (Name) box at the top of the properties list. In keeping with Visual Basic convention, the name of Label controls usually start with lbl, so lets call this control lblPrompt.

To change the text that appears for the label, you change the Caption property in the same way. We can change the caption of this label to 'Please enter your name'. Once you have done that, you might find that if you look back to the form, you can't see all of the text. If this is the case, select the control, and resize it so that you can.

James first started writing tutorials on Visual Basic in 1999 whilst starting this website (then known as VB Web). Since then, the site has grown rapidly, and James has written numerous tutorials, articles and reviews on VB, PHP, ASP and C#. In October 2003, James formed the company Developer Fusion Ltd, which owns this website, and also offers various development services. In his spare time, he's a 3rd year undergraduate studying Computer Science in the UK. He's also a Visual Basic MVP.

Comments

  • Re: [30] Complete VB Beginners Tutorial

    Posted by pcmenegusso on 06 Jun 2008

    what's "grammer" anyway? and who's needing it here?

  • Re: beginner...

    Posted by HartTechService on 27 May 2008

    No offense, but you might want to brush up on your English grammer skills first.  "We'll gonna"= We will gonna or going too??????  This just makes no sense.  "We are ...

  • beginner...

    Posted by Tessa07 on 13 Jun 2007

    Hi evry1..
    I take IT course, n we'll gonna use VB for nxt semester.1st n 2nd semester we already have C n C++,so  i hope any1 here can help me out..TQVM..

  • New to VB.net

    Posted by asingh9 on 08 Sep 2005

    Hi,
    I have been using Visual Basic for one year. Now, I want to switch to VB.net as it is the latest technology. I am totally confused how should I go about doing this. Could you tell me the name of ...

  • Student edition

    Posted by eric2358 on 10 Aug 2005

    You may not be able to comile your code into an executable that would be portable, but your code can be copied into notepad files and kept for later use/reuse.