Print Page | Close Window

CXTPPropertyGridItem alignment = right ?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=5785
Printed Date: 17 September 2025 at 12:10am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPPropertyGridItem alignment = right ?
Posted By: Tomasz
Subject: CXTPPropertyGridItem alignment = right ?
Date Posted: 13 December 2006 at 1:40pm
Hi,
 
Is it possible to right-align CXTPPropertyGridItems ?
 
I searched docs and could not find any method to control alignment in propertygrid control.
 
Thanks in advance.
Tomasz



Replies:
Posted By: mgampi
Date Posted: 14 December 2006 at 2:13pm

Hi Tomasz;

I've done this multiple times with different item types. All I did was:

Create my own class derived from CXTPPropertyGridItem and
Overwrite CMyItem::OnDrawItemValue()

Within the function I used the CDC::DrawText function with DT_RIGHT.

Thats it!

Martin



Posted By: Tomasz
Date Posted: 14 December 2006 at 2:16pm
Thanks Martin, that what I was afraid of (yet another mod) :-(
 
Question to Oleg: is there any chance to have alignment control added to the library itself ???


Posted By: Oleg
Date Posted: 14 December 2006 at 2:41pm
Hi,
 
try pItem->GetValueMetrics()->m_uDrawTextFormat = DT_RIGHT|DT_VCENTER | DT_SINGLELINE;


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mgampi
Date Posted: 14 December 2006 at 2:45pm

Hi Oleg;

Knowing this a few month earlier would have reduced my development effort by about two weeks...

I'm trying it right now.
 
Martin



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