Bullets centering

General TRichView support forum. Please post your questions here
Post Reply
wray
Posts: 38
Joined: Thu Feb 14, 2008 8:36 pm
Location: Romania

Bullets centering

Post by wray »

Hi,

for this code:

RichView1->AddNL(TimeToStr(Now()) + " ", 2, 0);
RichView1->AddBulletEx("", 2, ImageList1, -1);
RichView1->Add(" Test line: ", 2);
RichView1->Format();

How do i get the bullet to be vertically centered like the text is ? Basicaly to be on the same level with the text becuase now is a couple pixels upper... If you select both the text and the bullet you will understand what i am saying.

Thank you
Vlad
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

VAlign property is available for bullets, so it's possible to change it from baseline to middle, abs-middle, abs-top or abs-bottom.
But this property was added to bullets later than adding AddBulletEx method, so you need to set it manually:

Code: Select all

RichView1->AddNL(TimeToStr(Now()) + " ", 2, 0); 
RichView1->AddBulletEx("", 2, ImageList1, -1); 
((TRVBulletItemInfo*)(RichView1->GetItem(RichView1->ItemCount-1)))->VAlign = rvvaAbsMiddle;
RichView1->Add(" Test line: ", 2); 
RichView1->Format(); 
wray
Posts: 38
Joined: Thu Feb 14, 2008 8:36 pm
Location: Romania

Post by wray »

Thank you very much.

Works 100%

Regards
Vlad
Post Reply