Thanks for your reply Jolyon, Unfortunately on show event fail to do its magic. Having said that i gave a try by assigning parentwindow of that control to parent handle, Since i assumed when parent window gets 0 value it triggers that exception. But i was wrong.
I need to work on some other way to get this working. I will post soon once i find a way to it. Thanks On Tue, Sep 6, 2011 at 5:49 PM, Jolyon Smith <[email protected]> wrote: > Combobox controls can be tricky as some pretty basic initialisations of > those controls require that messages be sent to the control which requires > that the underlying HWND has been allocated and that in turn requires that > the control's parent *also* has a HWND. > > Most often this can trip you up when you initialise these controls in the > constructor or OnCreate events of a form - the temptation is to think that > if the form has been "created" then there must be a window, right ? But > this isn't always the case. > > If the code that is causing you trouble is in a form constructor or > OnCreate event, try moving it to the OnShow event instead - this will occur > only after the form actually has an underlying window. If that solves the > problem then window timing is the problem and you should take a closer look > at the initialisation required by the control and the best place to perform > it. > > It may even be that you can simply leave the initialisation to occur in the > OnShow event. > > hth > > > On 6 September 2011 16:39, Vik Vasudev <[email protected]> wrote: > >> Hello Everyone, >> >> I am getting this "Control has no parent window error" when i try to load >> a form in insert mode. i mean to say it has datasource assigned to it. >> >> >> I have a Tabsheet with a panel control. >> >> So code snippet like. >> here Tdemo is derived from TCustomDropDownCheckBox >> >> X = Tdemo.create (self) >> X.parent := Panel. >> .X.datasource = yz; >> >> Problem is when the dataset is loaded in insert mode at first instance it >> gives this error. Then when i move to other component and comes back it >> works fine. >> >> I suspect parent handle is not getting assigned. >> >> Any help or idea on this be appreciated >> -- >> vikas >> >> _______________________________________________ >> NZ Borland Developers Group - Delphi mailing list >> Post: [email protected] >> Admin: http://delphi.org.nz/mailman/listinfo/delphi >> Unsubscribe: send an email to [email protected] with >> Subject: unsubscribe >> > > > _______________________________________________ > NZ Borland Developers Group - Delphi mailing list > Post: [email protected] > Admin: http://delphi.org.nz/mailman/listinfo/delphi > Unsubscribe: send an email to [email protected] with > Subject: unsubscribe > -- vikas
_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [email protected] with Subject: unsubscribe
