Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPPropertyGridItem alignment = right ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPPropertyGridItem alignment = right ?

 Post Reply Post Reply
Author
Message
Tomasz View Drop Down
Senior Member
Senior Member


Joined: 05 August 2006
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomasz Quote  Post ReplyReply Direct Link To This Post Topic: CXTPPropertyGridItem alignment = right ?
    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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1206
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Tomasz View Drop Down
Senior Member
Senior Member


Joined: 05 August 2006
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomasz Quote  Post ReplyReply Direct Link To This Post 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 ???
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1206
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
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.062 seconds.