返回列表 上一主題 發帖

[發問] 表單設計 顯示“額外選項”

回復 1# yutakano
用一個表單就能實現了,當按下選項按鈕時去顯示/隱藏其他控制項就可以了。

TOP

本帖最後由 stillfish00 於 2013-7-7 15:24 編輯

回復 1# yutakano
簡單範例: https://www.dropbox.com/s/0yulvt5j01mkjxa/%E7%AF%84%E4%BE%8B.xlsm
  1. Private Sub CommandButton1_Click()
  2.     Static bControl As Boolean  '控制是否展開
  3.     bControl = Not bControl
  4.    
  5.     If bControl Then
  6.         CommandButton1.Caption = "選項<<"
  7.         CommandButton1.Top = 100
  8.         ComboBox2.Width = 100
  9.         Label2.Visible = True
  10.         ComboBox1.Visible = True
  11.         CheckBox1.Visible = True
  12.     Else
  13.         CommandButton1.Caption = "選項>>"
  14.         CommandButton1.Top = 36
  15.         ComboBox2.Width = 180
  16.         Label2.Visible = False
  17.         ComboBox1.Visible = False
  18.         CheckBox1.Visible = False
  19.     End If
  20. End Sub
複製代碼

TOP

        靜思自在 : 有多少力量就做多少事,不要心存等待,等待才會落空。
返回列表 上一主題