V vlaomao Unregistered / Unconfirmed GUEST, unregistred user! 2009-06-26 #1 其中 FORM1,FORM2 是窗体,ANAME,BNAME 是窗体名字。cbb1.Items.AddObject('ANAME',Form1) ;cbb1.Items.AddObject('BNAME',Form2)我想要的结果是 选择 COMBOX 中 BNAME ,FORM2 就SHOW
其中 FORM1,FORM2 是窗体,ANAME,BNAME 是窗体名字。cbb1.Items.AddObject('ANAME',Form1) ;cbb1.Items.AddObject('BNAME',Form2)我想要的结果是 选择 COMBOX 中 BNAME ,FORM2 就SHOW
D de410 Unregistered / Unconfirmed GUEST, unregistred user! 2009-06-26 #2 procedure TForm1.ComboBox1Select(Sender: TObject); begin if cbb1.ItemIndex=1 then //1为'BNAME',Form2在cbb1中的序号 form2.show; end;
procedure TForm1.ComboBox1Select(Sender: TObject); begin if cbb1.ItemIndex=1 then //1为'BNAME',Form2在cbb1中的序号 form2.show; end;
W wind_2005 Unregistered / Unconfirmed GUEST, unregistred user! 2009-06-28 #3 procedure TForm1.Button1Click(Sender: TObject); begin form2 := TForm2.Create(Self); form3 := TForm3.Create(Self); ComboBox1.AddItem('form2',Form2); ComboBox1.AddItem('form3',Form3); end; procedure TForm1.ComboBox1Change(Sender: TObject);var f: TForm; begin f := TForm( ComboBox1.Items.Objects[ComboBox1.ItemIndex]) ; f.Show; end;
procedure TForm1.Button1Click(Sender: TObject); begin form2 := TForm2.Create(Self); form3 := TForm3.Create(Self); ComboBox1.AddItem('form2',Form2); ComboBox1.AddItem('form3',Form3); end; procedure TForm1.ComboBox1Change(Sender: TObject);var f: TForm; begin f := TForm( ComboBox1.Items.Objects[ComboBox1.ItemIndex]) ; f.Show; end;