Board index » cppbuilder » Getting access to one column text font in a StringGrid component

Getting access to one column text font in a StringGrid component


2004-09-14 11:55:45 PM
cppbuilder53
Hello Everybody,
Im working with C++ Builder 5.0.
In my project, Im working with a StringGrid component which has two columns
and several rows. Id like to change the font of all the text in the left
column (to put them in bold, i. e.), not the right ones, but I dont know
how to get access to an specific column text font.
Anybody can help?
Thanks in advance.
 
 

Re:Getting access to one column text font in a StringGrid component

"Frank Chisme" < XXXX@XXXXX.COM >wrote:
Quote

[...] Id like to change the font of all the text in the left
column (to put them in bold, i. e.), not the right ones,
You need to set the grid's DefaultDrawing property to false
and add an OnDrawCell event.
Sample code:
groups.google.com/groups
All you need to do is is modify the sample to change the
font's attributes:
// add bold
pCanvas->Font->Style = pCanvas->Font->Style << fsBold;
// remove bold
pCanvas->Font->Style = pCanvas->Font->Style>>fsBold;
~ JD
 

Re:Getting access to one column text font in a StringGrid component

Thank you ID!
Im trying it.
"JD" < XXXX@XXXXX.COM >escribi?en el mensaje
Quote

"Frank Chisme" < XXXX@XXXXX.COM >wrote:
>
>[...] Id like to change the font of all the text in the left
>column (to put them in bold, i. e.), not the right ones,

You need to set the grid's DefaultDrawing property to false
and add an OnDrawCell event.

Sample code:


groups.google.com/groups
cppbuilder.vcl.components.using&hl=en&lr=lang_en&ie=UTF-8&safe=off&selm=40a2
f8fa%241%40newsgroups.borland.com&rnum=1
Quote

All you need to do is is modify the sample to change the
font's attributes:

// add bold
pCanvas->Font->Style = pCanvas->Font->Style << fsBold;

// remove bold
pCanvas->Font->Style = pCanvas->Font->Style>>fsBold;

~ JD

 

{smallsort}