 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jens Gruschel Guest
|
Posted: Tue Oct 14, 2003 9:48 pm Post subject: TCustomListBox / TScrollingWinControl / ...? |
|
|
I want to create a control and don't know from which control to derive.
TCustomListBox or TScrollingWinControl might be possible, but both have some
disadvantages. Maybe there is another alternative?
My control should display some items with different height, that the control
draws itself (any one of these items can be selected), and a vertical
scrollbar (no horizontal scrollbar).
I could derive from TCustomListBox, set Style to lbOwnerDrawVariable, and
override MeasureItem and DrawItem. But I need no Items property, which is
published in TCustomListBox, and which is important for TCustomListBox (even
if I ignore the texts while drawing, Items.Count is needed). And you cannot
scroll pixel-accurate, which might be a problem for very large items.
TScrollingWinControl sounds like more work, but might be more flexible.
Unfortunatelly HorzScrollBar is a published property (while I could set
HorzScrollBar.Visible to false in the constructor it could still be changed
in the designer).
Maybe I could also derive from TCustomControl and add a vertical scrollbar
somehow (whereas I don't like TScrollBar very much, because it doesn't look
very Windows(XP)-like and must be measured with GetSystemMetrics to have the
same size than other scrollbars).
Any other ideas?
Jens
|
|
| Back to top |
|
 |
Kurt Barthelmess Guest
|
Posted: Wed Oct 15, 2003 12:28 pm Post subject: Re: TCustomListBox / TScrollingWinControl / ...? |
|
|
"Jens Gruschel" <nospam (AT) pegtop (DOT) net> wrote:
| Quote: | I want to create a control and don't know from which control to derive.
TCustomListBox or TScrollingWinControl might be possible, but both have some
disadvantages. Maybe there is another alternative?
|
[clip]
I had something like this and ended up using a TPanel descendant.
Another possibility would be a TScrollBox with an embedded TPaintBox.
Good luck.
Kurt
|
|
| Back to top |
|
 |
Jens Gruschel Guest
|
Posted: Wed Oct 15, 2003 9:34 pm Post subject: Re: TCustomListBox / TScrollingWinControl / ...? |
|
|
| Quote: | I had something like this and ended up using a TPanel descendant.
Another possibility would be a TScrollBox with an embedded TPaintBox.
Good luck.
|
Thanks. I think I've found what I was searching for. I'm using a simple
TCustomControl, adding some code for a vertical scrollbar (WS_VSCROLL in
CreateParams, catching WM_VSCROLL, using some GetScrollInfo / SetScrollInfo
api calls etc).
Jens
|
|
| Back to top |
|
 |
|
|
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
|
|