BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

StringGrid

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
LMario
Guest





PostPosted: Fri Feb 10, 2006 9:03 am    Post subject: StringGrid Reply with quote



How can I join cells in a TStringGrid, i.e. removing the grid lines between
some of the cells? I am using CBuilder 2006.

Thanks
Back to top
JD
Guest





PostPosted: Fri Feb 10, 2006 11:03 am    Post subject: Re: StringGrid Reply with quote



"LMario" <lefalme (AT) prodigy (DOT) net.mx> wrote:
Quote:

How can I join cells in a TStringGrid, i.e. removing the
grid lines between some of the cells?

Set the grid's DefaultDrawing property to false and add an
OnDrawCell event.

If you move into the Object Inspector and enter that event and
press F1, there should be an example (at least there was with
BCB6). Otherwise, search the archives:

http://www.tamaracka.com/search.htm

Once you get the event properly painting the grid, then you
need to check the ACol parameter. For example, if you want to
join column's 2 and 3, you would only need to act on detecting
either column 2 *or* column 3.

Another parameter to the event is a TRect that bounds the cell
that's being drawn. You can extend that Rect to the left or to
the right so that when you call TCanvas::FillRect, the grid
line will be painted over.

~ JD
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.