看板 Visual_Basic 關於我們 聯絡資訊
各位前輩好 我想請問一個關於checkbox的問題... 嗯 就是啊 我在frame2裡面 拉了六個checkbox進去 裡面的選項就是一些興趣的東西 看電影啊 唱歌啊 聽音樂啊 等等 然後如果我勾選幾個不等的興趣 最後會show在msgbox裡 因為還有別的東西 所以我先把結果寫在一個參數interest裡 以下是我的程式碼: -------------------------------------------- interest = "" If Check1.Value = 1 Then interest = "看電影" ElseIf Check3.Value = 1 Then interest = interest + "寫書法" ElseIf Check4.Value = 1 Then interest = interest + "放空" ElseIf Check6.Value = 1 Then interest = interest + "唱KTV" ElseIf Check7.Value = 1 Then interest = interest + "看電視" ElseIf Check9.Value = 1 Then interest = interest + "上網" End If -------------------------------------------- 可是最後我測試的結果 譬如說 我勾選3個 有"看電影"、"放空"、"上網" 可是msgbox只會show出第一個"看電影" 後面兩個都沒show出來...@@" 想請問各位前輩 我哪裡出錯了 得怎麼改才好!? ^^" -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.141.100.58
colawei:結構錯誤 把那一大串If全部拆掉就行了 05/13 00:10
unget:因為你用了else...= = 05/13 01:45
LinLeopold:感恩 感恩 寫出來了... ^^ 05/13 04:47
fumizuki:把Else四個字都拿掉 05/13 10:20