Results 1 to 4 of 4

Thread: TEXTBOX

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    153
    I'm trying to control the text in some textboxes at run-time using the IF THEN feature. I want to know how i can control how the text is displayed in the text boxes. For example,

    if combo2.text = qtr1 then
    text1.text = "ACTUAL 3/31/00"

    I want the word ACTUAL on one line and the 3/31/00 on the line underneath. I would like to center both. Is this possible? Thanks

  2. #2
    Lively Member
    Join Date
    Mar 2000
    Posts
    81
    A normal textbox doesn't allow you to center text. You could use a richtextbox, though. Or if the user doesn't need to be able to change it, how about a label?

    Toot
    Some cause happiness wherever they go; others, whenever they go.

  3. #3
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    Actually, a regular textbox WILL let you center text, but ONLY if the Multiline property is set to true (if Multiline is False, then the Alignment property has no effect; the text is always aligned left). Toot's label suggestion is good if the user doesn't need to change the text. In response to your orignal question, you could do this:
    set the Multiline property to True
    set the Alignment property to Center
    In code:
    Text1.Text = "ACTUAL" & vbNewLine & "3/31/00"

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    153
    Thanks! Got it to work using both methods.

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