Print Page | Close Window

How to vertical center a text

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=16787
Printed Date: 03 May 2024 at 11:20pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to vertical center a text
Posted By: fjosesen
Subject: How to vertical center a text
Date Posted: 04 June 2010 at 5:52am
    Hi,
 
    Due to the bug with the disabling of a checkbox, I'm trying to simulate it with an image and a text at the side. I'm trying to define a text vertically centered with this code without success:
 
  <TextBlock Height="26" VerticalAlignment='Center'>
   Is there any way I can perform this drawing?
 
    Regards,
 
Jose
 


-------------
Products: Suite Pro (ActiveX) v18.0.1
          Toolkit Pro (MFC) v18.0.1
Platform: Windows 10 (64bit)
Language: VC++ 2013 (MFC)



Replies:
Posted By: jpbro
Date Posted: 04 June 2010 at 11:35am
I tried that code in the MarkupPad and the text is vertically centered - unless the TextBlock is the child of another tag (for example, a StackPanel), and then I had to set the VerticalAlignment attribute to Center for the parent as well.

If you are still unable to get the TextBlock vertically centered, can you post your complete XAML so I can see if I can figure out why it's not centering?



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




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