先用一个全局变量纪录你按了第一个窗口的哪个按钮。然后用一个2维数组设置要打开的窗口。把第一个和第二个窗口的按钮建成按钮数组。如:public b as integer public aForm(2,2) as from aForm(0,0)=frm00 aForm(0,1)=frm01 ....... aForm(2,2)=frm22在form1中: private sub button_click(Index As Integer) b=index form2.show end sub 在form2中: private sub button_click(Index As Integer) aForm(b,index).show end sub
public aForm(2,2) as from
aForm(0,0)=frm00
aForm(0,1)=frm01
.......
aForm(2,2)=frm22在form1中:
private sub button_click(Index As Integer)
b=index
form2.show
end sub
在form2中:
private sub button_click(Index As Integer)
aForm(b,index).show
end sub