Option ExplicitPrivate Sub Command1_Click() Form2.Show Form3.Hide
End SubPrivate Sub Command2_Click() Form3.Show Form2.Hide End SubPrivate Sub Form_Load() Form2.Hide Form3.Hide End Sub
我最主要是不明白你说的“form2或者form3都不见了。”和“Form2或Form3窗体都在Form1窗体上。”指的是什么意思。试试这是不是你想要的?????: Private Sub Command1_Click() Form3.Hide Form2.Show End Sub Private Sub Command2_Click() Form2.Hide Form3.Show End SubPrivate Sub Form_Click() If Form2.Visible = True Then Form2.SetFocus If Form3.Visible = True Then Form3.SetFocus End Sub
Private Sub Command1_Click() Form2.Show End SubPrivate Sub Command2_Click() Form3.Show End SubPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) Form2.Show Form3.Show End Sub 兄弟,试试这个!
我想要单击form1窗体的其他地方,form2或者form3都可以显示。
方法2:用api:setwindowpos把form2或form3设置为alwaysontop的窗体。
Form2.Show
Form3.Hide
End SubPrivate Sub Command2_Click()
Form3.Show
Form2.Hide
End SubPrivate Sub Form_Load()
Form2.Hide
Form3.Hide
End Sub
Private Sub Command1_Click()
Form3.Hide
Form2.Show
End Sub
Private Sub Command2_Click()
Form2.Hide
Form3.Show
End SubPrivate Sub Form_Click()
If Form2.Visible = True Then Form2.SetFocus
If Form3.Visible = True Then Form3.SetFocus
End Sub
Form2.Show
End SubPrivate Sub Command2_Click()
Form3.Show
End SubPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Form2.Show
Form3.Show
End Sub
兄弟,试试这个!
我想要不管单击form1窗体的其他地方,当前窗体form2或者form3不变,还显示在form1窗体上。就是form1窗体上,除2个按钮外,单击其他地方不可用。