Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2001
    Location
    Portland, OR USA
    Posts
    39

    Grin How do I keep a Label Object a constant size?

    I'm Setting the text in a Label, but I want the centerpoint of the text to stay in one location, centered above an image. If for example I start with "This is my label text", correctly aligned, when I Set the text to "New Text", the centerpoint shifts to the left as the Label object resizes. If I put in extra spaces " New Text " it aligns correctly. I've tried force the Label length with Label.SetSize and also change only the text tblLabelProperties.Text = "New Text" after Label.GetProperties, but the text is never correctly centered.

    Any suggestions on another way to accomplish this?

    Jim Smiley

  2. #2
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi, if you set your label to "center align" (see attached) it should help some...
    Attached Images

  3. #3
    Join Date
    Nov 2001
    Location
    Portland, OR USA
    Posts
    39

    Grin Label Alignment Problem

    Corey;

    Thanks for the quick response. My label was configured as you suggested and worked fine with the original text. (See Right attachment) The problem comes when I change the text. (See Wrong attachment)

    Is it possible to use one Label Object and keep the center of the text at a specific coordinate or am I going to need 24 seperate Labels?

    Thanks for the help

    JRS
    Attached Images

  4. #4
    Join Date
    Jan 2000
    Posts
    2,002
    What about using a Paragraph object instead of a Label? Then you can set the paragraph to stretch across the entire area and center the text. Unless there is a specific reason you are using a Label, that would be the way to go.

    If you do want to use a label, set the text, get the size of the object and then calculate the center:

    X = (MaxWidth - LabelWidth) / 2

    Then set the position to X.

  5. #5
    Join Date
    Nov 2001
    Location
    Portland, OR USA
    Posts
    39

    Smile Thanks Brett

    Paragraph makes too much sense.

    I guess since I started with a Label, I convinced myself that was the way to go. Couldn't see the forest, till a tree fell on me.

  6. #6
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Couldn't see the forest, till a tree fell on me.
    Hee.

Similar Threads

  1. Example: Sending An Email Through Outlook
    By Brett in forum AutoPlay Media Studio 5.0 Examples
    Replies: 22
    Last Post: 12-05-2005, 06:11 PM
  2. changing label font size
    By Buffman in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 03-16-2005, 07:37 PM
  3. INFO: Difference between the Media Player Object and the AVI Object
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-29-2002, 02:15 PM
  4. HOWTO: Make a Media Player Object Go Full Screen
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-23-2002, 11:23 AM
  5. Replies: 0
    Last Post: 10-04-2002, 10:09 AM

Posting Permissions

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