Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Components Writing > TSrinGrid has n...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 10 Topic 77 of 155
Post > Topic >>

TSrinGrid has no parent

by paulmccabe51@[EMAIL PROTECTED] (PMC) Jul 26, 2004 at 12:56 AM

Hi,
I am new to Delphi and I am trying to alter an existing activex.
The Component basically creates a form at runtime and allows the user
to design the form by adding controls (editbox, checkbox label….)
I wish to allow the user to add a TStrinGrid, however the Grid will
display on the form  and allow me to resize it but after it loses
focus clicking on it produces the

Control has no parent window error

I can't seem to trap the piece of code or event that causes the error

The code works fine for other controls but seems to come unstuck with
the Grid

Code Snippet below:

function TSForm.CreateControl(ControlType: TControlType; Top, Left,
Width, Height: integer):TControl;
var
  NewControl: TControl;

begin
  if not DesignMode then
    raise Exception.Create('S form must be in design mode to use
CreateControl function.');

  NewControl := SCl*****[ord(ControlType)].Create(Self);  
  NewControl.Parent := self;

end;


Thanks in advance for any help , similar experiences or debugging
advice appreciated
 




 10 Posts in Topic:
TSrinGrid has no parent
paulmccabe51@[EMAIL PROTE  2004-07-26 00:56:10 
Re: TSrinGrid has no parent
paulmccabe51@[EMAIL PROTE  2004-07-26 08:27:32 
Re: TSrinGrid has no parent
"Bruce Roberts"  2004-07-26 11:49:00 
Re: TSrinGrid has no parent
paulmccabe51@[EMAIL PROTE  2004-07-28 06:44:15 
Re: TSrinGrid has no parent
"Bruce Roberts"  2004-07-28 15:01:27 
Re: TSrinGrid has no parent
paulmccabe51@[EMAIL PROTE  2004-07-29 01:39:09 
Re: TSrinGrid has no parent
"Bruce Roberts"  2004-07-29 09:29:36 
Re: TSrinGrid has no parent
paulmccabe51@[EMAIL PROTE  2004-07-29 07:54:03 
Re: TSrinGrid has no parent
Jamie <jamie_5_not_val  2004-08-01 10:43:36 
Re: TSrinGrid has no parent
paulmccabe51@[EMAIL PROTE  2004-08-02 02:25:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 18:35:52 CDT 2008.