Good Morning!
I have noticed some funny business with this test app.
I have a main form and a child form.
The child form is created at runtime and gets a panel on main as
the parent.
There are 2 comboboxes, an edit control, a checkbox and a button.
The child form borderstyle is bsSizeable.
When running, the comboboxes and the edit will will not take focus
by clicking with the mouse. Bummer.
The checkbox and button will.
Has anyone else seen something like this? Can anyone explain it?
I first saw this in D6 Pro. The same thing happens with D5 Ent and
D7 Pro. Of course, Win XP SP2.
Here is the complete code:
program ChildForm;
uses
Forms,
fChild in 'fChild.pas' {Form1},
fMain in 'fMain.pas' {Form2};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm2, Form2);
Application.Run;
end.
object Form2: TForm2
Left = 319
Top = 209
Width = 510
Height = 373
Caption = 'Form2'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 129
Top = 0
Width = 373
Height = 339
Align = alRight
Caption = 'Panel1'
TabOrder = 0
end
end
unit fMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, ExtCtrls, fchild;
type
TForm2 = class(TForm)
Panel1: TPanel;
procedure FormCreate(Sender: TObject);
private
frm1: tform1;
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
if not assigned (frm1) then
frm1 := tform1.Create(self);
frm1.Parent := panel1 ;
frm1.Align := alclient;
frm1.show;
end;
end.
object Form1: TForm1
Left = 405
Top = 133
Width = 415
Height = 245
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object ComboBox1: TComboBox
Left = 40
Top = 16
Width = 145
Height = 21
ItemHeight = 13
TabOrder = 0
Text = 'ComboBox1'
end
object ComboBox2: TComboBox
Left = 208
Top = 16
Width = 145
Height = 21
ItemHeight = 13
TabOrder = 1
Text = 'ComboBox2'
end
object Edit1: TEdit
Left = 40
Top = 56
Width = 121
Height = 21
TabOrder = 2
Text = 'Edit1'
end
object Button1: TButton
Left = 208
Top = 56
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 3
end
object CheckBox1: TCheckBox
Left = 48
Top = 96
Width = 97
Height = 17
Caption = 'CheckBox1'
TabOrder = 4
end
end
unit fChild;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Edit1: TEdit;
Button1: TButton;
CheckBox1: TCheckBox;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.
Thanks...Dan'l
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/