iT邦幫忙

0

VBA 新增Fram問題

vba
  • 分享至 

  • twitterImage

各位大大好
如標題所見,在VBA的Form視窗裡面建立了5個Frame及一個Button,並將所有Frame的Visible選擇False。目前想要做一個增加Frame功能,其實就是我按第一下時,Frame1的Visible變成True,再按一下時Frame2的Visible變成True...以此類推。不知道有沒有相關的解法Q___Q

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

1
paicheng0111
iT邦大師 5 級 ‧ 2021-01-20 09:23:43
最佳解答

大概會是

Private Sub CommandButton1_Click()
    
    Select Case True
        Case UserForm1.Frame1.Visible = False
            UserForm1.Frame1.Visible = True
        Case UserForm1.Frame2.Visible = False
            UserForm1.Frame2.Visible = True
        Case UserForm1.Frame3.Visible = False
            UserForm1.Frame3.Visible = True
        Case UserForm1.Frame4.Visible = False
            UserForm1.Frame4.Visible = True
        Case Else
    End Select

End Sub


sam22345 iT邦新手 5 級 ‧ 2021-01-20 10:27:54 檢舉

感謝高手指導QQ

我要發表回答

立即登入回答