Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > MarkupLabel Control
  New Posts New Posts RSS Feed - Text alignment in grid cells
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Text alignment in grid cells

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Text alignment in grid cells
    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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2017 at 7:29am
Hello;

Still no solution yet?
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.199 seconds.