Print Page | Close Window

Text alignment in grid cells

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: MarkupLabel Control
Forum Description: Topics Related to Codejock MarkupLabel Control
URL: http://forum.codejock.com/forum_posts.asp?TID=19274
Printed Date: 24 November 2024 at 3:13pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Text alignment in grid cells
Posted By: mgampi
Subject: Text alignment in grid cells
Date Posted: 06 December 2011 at 5:37pm
Hi;

Using the XAML source
<Page xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
  <StackPanel TextElement.FontFamily='Tahoma' Margin='3,3,3,3' Orientation='Horizontal'>
    <Image Margin='0, 0, 20, 0' VerticalAlignment='Bottom' Source='file://Industry.png'/>
    <Grid VerticalAlignment='Bottom'>
    <Grid.ColumnDefinitions>
       <ColumnDefinition/>
       <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions >
       <RowDefinition Height='Auto'/>
       <RowDefinition Height='Auto'/>
       <RowDefinition Height='Auto'/>
    </Grid.RowDefinitions>
    <TextBlock Foreground='SlateGray' Margin='0, 0, 10, 0' Grid.Column='0' Grid.Row='0' VerticalAlignment='Bottom'>Zeitraum:</TextBlock>
    <TextBlock Foreground='#404040' Grid.Column='1' Grid.Row='0' VerticalAlignment='Bottom' FontSize='18'>14.12.2011 bis 21.12.2011'</TextBlock>
    <TextBlock Foreground='SlateGray' Margin='0, 0, 10, 0' Grid.Column='0' Grid.Row='1' VerticalAlignment='Bottom'>Produktionsanlage:</TextBlock>
    <TextBlock Foreground='#404040' Grid.Column='1' Grid.Row='1' VerticalAlignment='Bottom' FontSize='18' TextWrapping='Wrap'>Zementmühle 4, Zementmühle 5</TextBlock>
    <TextBlock Foreground='SlateGray' Margin='0, 0, 10, 0' Grid.Column='0' Grid.Row='2' VerticalAlignment='Bottom'>Analysentyp:</TextBlock>
    <TextBlock Foreground='#303030' Grid.Column='1' Grid.Row='2' VerticalAlignment='Bottom' FontSize='18'>Produktionsproben</TextBlock>
    </Grid>
  </StackPanel>
</Page>


leads to not well aligned text.
So how do I have to change the XAML code to get the desired results?
  Here you can see the small baselines offset of about 1 pixel!


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Replies:
Posted By: mgampi
Date Posted: 06 March 2017 at 7:29am
Hello;

Still no solution yet?


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net