如何用treeview打开相应窗体?
主要就是实现跟菜单一样的功能,点击其子项,会弹出个窗口我的代码是procedure Tmainform.TreeView1Click(Sender: TObject);
var flag:integer;
begin
flag:=treeview1.Items.Item.SelectedIndex;
case flag of
flag:=1: zengjiayonghu.Show;
flag:=2: mimaform.Show;
flag:=3: if messagebox(handle,'是否真的退出系统','提示',mb_IconQuestion + mb_OkCancel)=idok then
close;
flag:=4: fangjianshezhi.Show;
flag:=5: sushefenpei.Show;
flag:=6: fangjianchaxun.Show;
flag:=7: laifangdengji.Show;
flag:=8: likaidengji.Show;
flag:=9: laifangjiluchaxun.Show;
flag:=10: weishengpingbijilu.Show;
flag:=11: pingbijieguochaxun.Show;
flag:=12: weijichuli.Show;
flag:=13: weijichaxun.Show;
flag:=14: group.Show;
end;
end;但第一句有错,请大家帮帮忙啦