Board index » delphi » Cannot click in TEdit.

Cannot click in TEdit.

Hi

I have a small program with two forms (form1 & form2)

the borderstyle property of form2 is "bsToolWindow".

form1 contains one button.... And when pressed, this button creates form2
and then sets the parent property of form2 to form1 and then Show the form.

   Form2 := TForm2.Create (Self);
   Form2.Parent := Form1;
   Form2.Show;

form2 has only an edit box.  The problem is that the edit box doesn't
respond to the click of the mouse.  I can focus the edit box using SETFOCUS,
or even use the tab key...  By the edit box is disabled when using the
mouse.  Is there a problem in what I'm doing???

Thanks

Martin

 

Re:Cannot click in TEdit.


Martin wrote..

Quote
> form1 contains one button.... And when pressed, this button creates form2
> and then sets the parent property of form2 to form1 and then Show the form.

>    Form2 := TForm2.Create (Self);
>    Form2.Parent := Form1;
>    Form2.Show;

> form2 has only an edit box.  The problem is that the edit box doesn't
> respond to the click of the mouse.  I can focus the edit box using SETFOCUS,
> or even use the tab key...  By the edit box is disabled when using the
> mouse.  Is there a problem in what I'm doing???

You're don't have to (shouldn't) set the parent of form2
remove that line and you should be able the access the
editbox.

--
Pieter.

Re:Cannot click in TEdit.


"Pieter Zijlstra" <pzijlstr...@freeler.nl> a crit dans le message news:
8m7cjm$m...@bornews.borland.com...

Quote
> You're don't have to (shouldn't) set the parent of form2
> remove that line and you should be able the access the
> editbox.

> --
> Pieter.

The thing is that I need to put the form2 parent to form1... putting the
form2 with the form1 as parent makes sure that form2 is a part
of the form1 window and not a form of it's own.  Putting the parent of form2
to form1 does exactly that.

Martin.

Re:Cannot click in TEdit.


Quote
In article <8m7bc7$m...@bornews.borland.com>,  wrote:
> I have a small program with two forms (form1 & form2)

> the borderstyle property of form2 is "bsToolWindow".

Change it to bsNone and your problem will vanish. For some reason forms
parented to other TWincontrols do not properly take focus with other border
styles. Seems to be a Windows problem, not a VCL problem.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads