in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Horizontal Alignment on a Label in a Canvas does not seem to work

Last post 04-22-2008 8:56 AM by C1_BernardoC. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-10-2008 11:46 PM

    Horizontal Alignment on a Label in a Canvas does not seem to work

    <my1:C1Label x:Name="lblCOMPARATIVE_NUMBER" Height="21" Width="19" Canvas.Left="153" Canvas.Top="32" Text="/:" FontSize="11" HorizontalAlignment="Right"/>

    I have also tried HorizontalContentAlignment and no effect either.

  • 04-22-2008 8:56 AM In reply to

    Re: Horizontal Alignment on a Label in a Canvas does not seem to work

    The HorizonalContentAlignment can be used to right-align text *within* the label. For example:

      c1Label1.AutoSize = AutoSize.Height;
      c1Label1.Width = 500;
      c1Label1.HorizontalContentAlignment = HorizontalAlignment.Right;
      c1Label1.Text = "right...";

    The HorzontalAlignment property will align the label control itself within a parent StackPanel (not a C1StackPanel).

    Neither property will affect the alignment of the control within a Canvas element though. You are supposed to position elements within the canvas yourself.

    Hope this helps.

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.