M
maldini610
Unregistered / Unconfirmed
GUEST, unregistred user!
panel中嵌入的窗体是随着按不同的按钮而出现的不同的窗体,下面的代码是我在网上找到的在一个panel中根据按钮的不同在panel中显示不同窗体的代码.
现在 我想通过 form1(假设它为不在panel中窗体) 传一个值给panel中窗体的 比如 使edit1的 text值 为1 应该 怎么办啊?
先谢谢了啊
var
NewDemoClass: TFormClass;
NewDemo: TForm;
begin
case (Sender as TMenuItem).Tag of
1:
NewDemoClass := TFBudgetset;
else
NewDemoClass := nil;
end;
if (ContainerPanel.ControlCount = 0) or not (ContainerPanel.Controls[0] is NewDemoClass) then
begin
if ContainerPanel.ControlCount > 0 then
ContainerPanel.Controls[0].Free;
if Assigned(NewDemoClass) then
begin
NewDemo := NewDemoClass.Create(Self);
NewDemo.Hide;
NewDemo.BorderStyle := bsNone;
NewDemo.Parent := ContainerPanel;
NewDemo.Align := alClient;
if SkinData1.Active then
SkinData1.AddNestForm(self,NewDemo);
NewDemo.Show;
StatusBar1.Panels[0].Text := NewDemo.Caption;
end;
end;
现在 我想通过 form1(假设它为不在panel中窗体) 传一个值给panel中窗体的 比如 使edit1的 text值 为1 应该 怎么办啊?
先谢谢了啊
var
NewDemoClass: TFormClass;
NewDemo: TForm;
begin
case (Sender as TMenuItem).Tag of
1:
NewDemoClass := TFBudgetset;
else
NewDemoClass := nil;
end;
if (ContainerPanel.ControlCount = 0) or not (ContainerPanel.Controls[0] is NewDemoClass) then
begin
if ContainerPanel.ControlCount > 0 then
ContainerPanel.Controls[0].Free;
if Assigned(NewDemoClass) then
begin
NewDemo := NewDemoClass.Create(Self);
NewDemo.Hide;
NewDemo.BorderStyle := bsNone;
NewDemo.Parent := ContainerPanel;
NewDemo.Align := alClient;
if SkinData1.Active then
SkinData1.AddNestForm(self,NewDemo);
NewDemo.Show;
StatusBar1.Panels[0].Text := NewDemo.Caption;
end;
end;