看板 Visual_Basic 關於我們 聯絡資訊
在程式一執行 先定義個a 為 0 Private Sub Command2_Click() a = a + 1 if a mod 2 = 0 then Image2.Visible = true else Image2.Visible = false end if end sub 另一種寫法 Private Sub Command2_Click() if Image2.Visible = True then Image2.Visible = False else Image2.Visible = True end if End Sub : Private Sub Command2_Click() : Image2.Visible = True : End Sub : 這是按一下顯示圖片 : 那如果要按一下顯示...再按一下不顯示 : 要怎麼做呢? : 請幫我解答一下 謝謝^^ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.113.171.197 ※ 編輯: BearWu 來自: 59.113.171.197 (04/14 00:55)
smallcoldair:第一種寫法要加上 Static a 哦 ^^ 04/14 00:58
luludo:喔喔...謝謝你們喔...不過我想問 a mod 2 = 0 是什麼意思 04/14 00:59
luludo:這一句我看不懂 04/14 01:00
BearWu:mod 2 也就是,當a 等於偶數的時候就開圖,單數就關圖 04/14 01:48