Thread: TLabel in BorlandBuilder5 help!!!

  1. #1
    pete77
    Guest

    Post TLabel in BorlandBuilder5 help!!!

    Can anyone give me an example on how to use the TLabel in Borland builder?

    Thanks a lot!

    Pete

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    9
    You choose the TLabel component from the component pallete. Then you click on the form where you want to put it. You can then change the text in the label by changing the Caption property in the object inspector.

    Need any more info?

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    20

    Re: TLabel in BorlandBuilder5 help!!!

    Thanks for your response. I tried that, but I doesn't give me the results I want.
    All I want is to print "Hello world" and all I get is a grey screen without output.
    As you can see I'm just learning this and any feedback on how to get that output will be appreciated.

    Thanks!

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    20

    Re: TLabel in BorlandBuilder5 help!!!

    In other words, I want to have "hello world" print by using code; either this code or any code that works with builder5.

    #include <iostream.h>
    main ()
    {
    cout<<"hello world";

    return 0;
    }
    Jim S.

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    9
    Ok, I'll try to make it a little more detailed.

    1) Click on the label component.

    2) click on the form(It's the grey window that will say something like "Form1" unless you changed that). It will display a label with the labels name as the caption.

    3) there should be a windows to the left of the form called the object inspector. The top drop down list should say something like "Label1 : TLabel". and below the drop down listthere should be a list of properties. To change the text you change the text in the Caption property. On the form it should now say what you put in that property.

    If you still can't figure it out, I could give you an example "Hello World" project.

  6. #6
    Registered User
    Join Date
    Feb 2002
    Posts
    20

    Re: TLabel in BorlandBuilder5 help!!!

    Hey Thanks again, I was able to print with the instructions. Is there any way I can print it just by using code as in the example?
    If you can give an "Hello World" example with code and where to inserted, it would be great.

    Thanks for your help!
    Jim S.

  7. #7
    Registered User
    Join Date
    Dec 2001
    Posts
    9
    There might be a way, but why would you want to do that. if you want to change the Caption in code, you can use code like:
    Code:
    Label1->Caption = "whatever";
    I don't really know if there is a way to make a label using JUST code in BCB.

    -kje11

  8. #8
    Registered User
    Join Date
    Feb 2002
    Posts
    20

    Re: TLabel in BorlandBuilder5 help!!!

    Thanks once again for all your help! The only reason I wanted to do it like that is to practice what I learned in class today. In the Lab, we have this old compiler called Turbo C++ and even though it's from Borland, it does things differently. With that program, the only way to get that output is by typing the code shown in the example.

    Thanks for all your help!!!
    Jim S.

  9. #9
    Unregistered
    Guest
    BCB and VC++ have the capacity to build projects in text (aka console or DOS) mode and graphical mode. TLabel is one way to get things shown on the screen in graphical mode. To use iostream and cout you would be in text/console/DOS mode however. If you click on File and then new application you should be given a menu of options as to which mode you wish to use to build/make the current project/application. Choose the Console/text/Dos mode option if you want to use text mode programming. Leave it at default setting if you wish to use graphical/Windows mode.

    In Windows, all output to the screen is in graphical mode. cout and cin play no (or very little routine) role. Things are "event" driven, meaning a button is "pushed", the mouse moves over a given spot on the scree, a change occurs in an edit box secondary to user input, etc. none of which are pertinent to text mode. Although it isn't obvious when using BCB, use of classes, inheritance, etc. are useful in Windows, although use of control loops, knowing how lists, arrays, queues, etc. and even knowing about the standard template library all have a big impact. Learning how to program in text mode before going to graphical mode, eventhough you can make a basic Window program pretty easy with BCB, is something I think that will be worth your while.

Popular pages Recent additions subscribe to a feed