VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 12[3]45678910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 12:52:20 06/18/03 Wed
Author: Daniel Pertin
Subject: TStringGrid component with TListBox inside

Hi all,

I'm programming a component that is a derivate from TStringGrid. I want to put inside a TListBox component, so in each cell of the grid I'll be able to have multiple Items. (Well, in fact it isn't a TListBox rather than an own component derivated from it, but for the question, it should be enough with that infomration).

I Associated the TListBox to the TStringGrid with:

TStringList1->Objects[x][y]=objListBox;

I don't want to use scrolling inside each cell (it appears awfull), so when I add an Item in a TListBox inside a Cell, I grow up the Height of the TListBox, and the RowHeights[ARow].

Well, I have override the DrawCell method of the TStringGrid, so I can draw the TListBox.

void __fastcall TBitmapStringGrid:rawCell(int ACol, int ARow, const Types::TRect &ARect, TGridDrawState AState)
{
TListBox* objListBox = ( TListBox* )(Objects[ACol][ARow] );

if (objListBox != NULL) //only if there are data
{
objListBox->Top = ARect.Top;
objListBox->Left = ARect.Left;
objListBox->Height = ARect.Bottom - ARect.Top + 1;
objListBox->Width = ARect.Right - ARect.Left + 1;
objListBox->Visible = True;
}
Canvas->Brush->Color=clWhite;
Canvas->FillRect(ARect);
}

The problem is that when I scroll, it does extrange things. It overwrites the blank cells, and I'm unable to get that it scrolls correctly. The TlistBox component don't scroll when the TStrginGrid scroll.

I Read in <a rel=nofollow target=_blank href="http://www.bridgespublishing.com/ar...ids__part_I.htm">http://www.bridgespublishing.com/ar...ids__part_I.htm</a>
that (obviously) it's a known issue of this, but I'm unable to find a solution.

Help please!
Regards,
Daniel

[ Next Thread | Previous Thread | Next Message | Previous Message ]

[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.