Re: When to create TCustomControl's child controls?



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');

.



Relevant Pages

  • Re: WMP control resizing
    ... > getting the WMP9 activex control in a window and playing movies etc. ... when you want to resize the control in MFC, ...
    (microsoft.public.windowsmedia.sdk)
  • Re: Image Resize
    ... control is wrapped within a class to allow the control to resemble the ... I've been trying numerous ways to resize images, as I want to make store ... String, intNewWidth As Integer, intNewHeight As Integer) ... Dim sglAspect As Single ...
    (comp.databases.ms-access)
  • Re: SDI/CFormView/TabCtrl resize problem.
    ... // Get the Tab Control and resize it accordingly. ... Only thing I don't like is that I'm resizing both the TabCtrl and the pages ...
    (microsoft.public.vc.mfc)
  • Re: Outlook Custom form - resize event handling
    ... Is Inspector represents the message window itself? ... hook on the form and will resize... ... I used standard Message template and added custom control on ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: Setwindowpos()-problem.Moving control is not happening.
    ... For this i need to resize and reposition the ... I am calling GetWindowRect to get the control ... >dimensions and after changing them i am trying to call SetWindowPos() ... if onlyresize means the window is ...
    (microsoft.public.vc.mfc)