Results 1 to 15 of 15

Thread: Adding alot of text to a lable

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    16

    Question

    I would greatly appreciate some help with this problem I'm having. I am a newby to VB 6.0. I am building a project in college that requires an about frm and a rules frm. I n the rules frm I just want to display the yahtzee game rules and the scoring rules. I did a forum search and could not come up with anything like I'm looking to do. I sure would like some help with this.

    Thanx,

    Neo1008

  2. #2
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    What is it you want to do?

    A labels caption length can be unlimited (unlike controls and forms), so you could put all you rules etc in one label. Or you could have seperate labels for each paragraph etc.

    I'm not sure i understand what it is your asking...


    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  3. #3
    Hyperactive Member CyberSurfer's Avatar
    Join Date
    Aug 2000
    Location
    Old London Town
    Posts
    425
    To produce a result similar to the below:

    Code:
    1) This is a rule
    2) This is another rule
    3) Yet another rule
    Investigate the use of the vbCrLf function.

    Clue...Stands for Visual Basic Carriage Return Line Feed.


    Hope this was of help...

  4. #4
    Addicted Member Shrog's Avatar
    Join Date
    Aug 1999
    Location
    Darkest Africa
    Posts
    186

    Smile

    You have to place a control on the form. The control that you place on the form will contain the text you want to display, so you could use a Label, Textbox, RichTextBox, etc.

    The Label control does not have a scrollbar, so only use this if all the text can fit into the control.

    The Textbox Control does have a scrollbar, and can hold quite a large amount of text. But all the text will look the same (i.e. you cannot have different colors, fonts, etc.)

    The RichTextBox can display formatted text, and would probably be the best control for a commercial app, but it is more complex and if I were you I'd use the TextBox.

    The Textbox has a Text property and that is where you would want to place your text.

    Create a sub procedure that places the text into the textbox. Use vbCrLf to add line breaks to the text:
    Code:
    Private Sub DisplayRules
        Dim Txt as String
    
        Txt = "YAHTZEE" & vbCrLf & vbCrLf
        Txt = Txt & "The Object of the Game" & vbCrLf
        Txt = Txt & "More rules and stuff" & vbCrLf
        .
        .
        .
        TxtRules.Text = Txt
    
    End Sub
    Hope this helps
    Shrog
    http://shrog.iwarp.com



  5. #5
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    or even the Constant vbCrLf

    ;-)


    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  6. #6
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    There is a greater overhead when using text boxes, so only use them if you need scroll bars etc, text editing etc.
    If it's just to show text, use labels.


    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  7. #7
    Addicted Member Shrog's Avatar
    Join Date
    Aug 1999
    Location
    Darkest Africa
    Posts
    186

    Big Overhead

    I don't think that overhead is an issue here.

    1. The user is not looking for fast performance when reading rules to a game.
    2. You'll have a hard time trying to fit everything into a label without scrollbars.
    3. Rules are often displayed in a help file, with formatting and hyperlinks. A textbox is very light in comparison.
    4. The user will only have one little textbox open. The overhead of this doesn't make a difference unless the user opens hundreds of instances, or if hundreds of users use it over a network.

    Shrog

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    16

    Talking Labels

    VB dudes are the coolest. HEHEHEHEHEHEHE!!!!! [^]

    This is what I'm looking to do, and it is not commercial. It's just a simple little class project called Yahtzee. We have to build a Yahtzee game that consist of a slshfrm, main frm, aboutfrm, rules frm. I have the splash and mainfrm and the about frm. I just need to put some text in the rule frm that is quite alot of text. I just want the user to be able to read it, and if need be scroll it down and up to view the rules and score chart.

    I think the text box is a good idea. I will try that out and let all of you know what comes of it and make the whole program down loadable from my server when done. It will be for free for you guys. HEHEHEHEHEHEHE!!!!!!

    Thanx for such a quick response.

    Neo1008.

    If there are anymore suggestions just post it.[^]
    Free Your Creative Spirit
    -----------------------------------

  9. #9
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    Shrog, it was a rule of thumb.


    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    16

    Talking lables

    I hope this is not going to start an argument.


    [Edited by Neo1008 on 11-14-2000 at 04:51 AM]
    Free Your Creative Spirit
    -----------------------------------

  11. #11
    Addicted Member Shrog's Avatar
    Join Date
    Aug 1999
    Location
    Darkest Africa
    Posts
    186

    Wink

    No, of course not. No offense was meant.

    I'm glad that we could help.
    Good luck!
    Shrog

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    16

    Talking lables

    cool I glad to heart that.
    Free Your Creative Spirit
    -----------------------------------

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    16

    Question A rich text box

    where is the rich text control located in VB 6.0
    Free Your Creative Spirit
    -----------------------------------

  14. #14
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Press Ctrl+T, Check the Microsoft Rich Text Control in the list and press ok
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  15. #15

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    16

    Thumbs up Labels,RichTextBoxes

    Kool Thanx For the help.
    Free Your Creative Spirit
    -----------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width