C
charles2002
Unregistered / Unconfirmed
GUEST, unregistred user!
在创建一个由模板窗体继承而来的子窗体时如何对该子窗体的对象成员赋初值
又怎样对由模板窗体的私有对象赋值?
我的程序是这样的:
TMyForm由TTemple继承产生,TTemple中有若干个控件,我需要在主窗体MainForm
中创建TMyForm时对TMyForm的控件成员赋值,我尝试在TMyForm或TTemple中执行
procedure TTemple.WMCreated (var Msg: TMESSAGE);
begin
if (Msg.Msg = WA_ACTIVE) or (Msg.Msg = WM_CREATE) then
begin
Enabled := True
//在TTemple中自定义的私有成员
AttachTo := Null
RadioGroup1.ItemIndex := 0
//在TTemple中的控件成员
RadioGroup2.ItemIndex := 0;
ShowMessage('the message is receive');
end;
MainForm中执行 NewForm:=TMyForm.create(application);
end;
又怎样对由模板窗体的私有对象赋值?
我的程序是这样的:
TMyForm由TTemple继承产生,TTemple中有若干个控件,我需要在主窗体MainForm
中创建TMyForm时对TMyForm的控件成员赋值,我尝试在TMyForm或TTemple中执行
procedure TTemple.WMCreated (var Msg: TMESSAGE);
begin
if (Msg.Msg = WA_ACTIVE) or (Msg.Msg = WM_CREATE) then
begin
Enabled := True
//在TTemple中自定义的私有成员
AttachTo := Null
RadioGroup1.ItemIndex := 0
//在TTemple中的控件成员
RadioGroup2.ItemIndex := 0;
ShowMessage('the message is receive');
end;
MainForm中执行 NewForm:=TMyForm.create(application);
end;