Page 1 of 1

Bullets centering

Posted: Sun Feb 17, 2008 5:39 pm
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

Posted: Sun Feb 17, 2008 7:28 pm
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(); 

Posted: Sun Feb 17, 2008 8:02 pm
by wray
Thank you very much.

Works 100%

Regards
Vlad