Set length of embedded components

General TRichView support forum. Please post your questions here
Post Reply
Kern
Posts: 25
Joined: Mon Aug 07, 2006 3:49 pm

Set length of embedded components

Post by Kern »

Hi

What is the best place to set the correct width and hight of embedded components like TCheckBox and TGroupBox.
And how do i calculate the values? They have no Canvas to get it by Canvas.TextLengt(). The Canvas of the "container"-RichView has an undefined value in OnControlAction.

Thanks
Sergey Tkachenko
Site Admin
Posts: 17606
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I guess you need to calculate it yourself.
You can use, for example, the form's canvas.
Assign the same font as the button caption, and call Canvas.TextWidth.
Add a reasonable amount for spacing and checkmark.
Post Reply