Re: When to create TCustomControl's child controls?
- From: "Riaan" <rmoll@xxxxxxxxxxxx>
- Date: 27 Oct 2005 02:14:49 -0700
BAH! I'm such an IDIOT!!!
Ok, here's the deal. I have written a commercial app for my company, a
"master" application with a treeview on the left, that manages
different types of objects (our company's different products).
Each type of product has it's own configuration control, which is
created at run time via conditional compilation (I need to be able to
disable certain product types, and the easiest and most convenient by
far is to have conditional sections in my enums and so forth)
THAT is why:
1) The control's dimensions are 0 in CreateWnd, because the control
hasn't been resized (I resize the control dynamically with a custom
procedure according to the properties of the product object)
2) "Loaded" never gets called because the control is not streamed in (I
don't use the IDE to drop it onto the form)
The solution was to simply set the width and height of the control to
an arbitrary value in CreateWND before I create the child controls,
everything works properly thereafter.
I'd been so used to creating VCL components that are dropped on the
form (with static child controls in them) that I had forgotten the
principles of why my code was misbehaving.
while true do WriteLn('Riaan is an idiot');
.
- Follow-Ups:
- Re: When to create TCustomControl's child controls?
- From: Bruce Roberts
- Re: When to create TCustomControl's child controls?
- From: Maarten Wiltink
- Re: When to create TCustomControl's child controls?
- References:
- When to create TCustomControl's child controls?
- From: Riaan
- Re: When to create TCustomControl's child controls?
- From: alanglloyd
- Re: When to create TCustomControl's child controls?
- From: Riaan
- When to create TCustomControl's child controls?
- Prev by Date: Re: Version after Version
- Next by Date: Re: Version after Version
- Previous by thread: Re: When to create TCustomControl's child controls?
- Next by thread: Re: When to create TCustomControl's child controls?
- Index(es):
Relevant Pages
|