| 會員 ![]() | 【求助】該如何只要以一個label顯示出我所勾的選項字樣?(Visual Basic) 大大幫忙一下,在程式碼中,我想要在以一個label就可以顯示出我所打勾的選項,可是我的問題出在我必須增設很多的label才能對應我所選擇的東西....該怎麼辦?明天就要交作業了..... 圖例: 我的VB程式檔案,幫我的人可以看看並且下載回去: http://litweb.999host.net/homework.frm = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 我的程式碼: Private Sub Command1_Click() ===>(確定的程式碼) Label5.Caption = Text1.Text If Option1.value = True Then Label7.Caption = Option1.Caption Else If Option2.value = True Then Label7.Caption = Option2.Caption Else Label7.Caption = "" End If End If If Option3.value = True Then Label9.Caption = Option3.Caption Else If Option4.value = True Then Label9.Caption = Option4.Caption Else If Option5.value = True Then Label9.Caption = Option5.Caption Else If Option6.value = True Then Label9.Caption = Option6.Caption Else Label9.Caption = "" End If End If End If End If If Check1.value = 1 Then Label11.Caption = Check1.Caption Else Label11.Caption = "" End If If Check2.value = 1 Then Label12.Caption = Check2.Caption Else Label12.Caption = "" End If If Check3.value = 1 Then Label13.Caption = Check3.Caption Else Label13.Caption = "" End If End Sub Private Sub Command2_Click() ===>(清除的程式碼) Text1.Text = "" Option1.value = False Option2.value = False Option3.value = False Option4.value = False Option5.value = False Option6.value = False Check1.value = 0 Check2.value = 0 Check3.value = 0 Label5.Caption = "" Label7.Caption = "" Label9.Caption = "" Label11.Caption = "" Label12.Caption = "" Label13.Caption = "" End Sub Private Sub Command3_Click() ===>(結束的程式碼) End End Sub = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = |
| 回覆 |
| 進階會員 | Re: 【求助】該如何只要以一個label顯示出我所勾的選項字樣?(Visual Basic) 直接將字串相加不就好了?! ex: Label11.Caption = "我的興趣是:" If Check1.value = 1 Then Label11.Caption = Label11.Caption + Check1.Caption End If If Check2.value = 1 Then Label12.Caption = Label11.Caption + Check2.Caption End If If Check3.value = 1 Then Label13.Caption = Label11.Caption + Check3.Caption End If 沒學過 vb, 不過應該沒錯吧.... :< |
| 回覆 |
| 會員 ![]() | 元件相加哦....使用"&" 例如: XX = Label1.caption & Label2.caption |
| 回覆 |
| |
類似的主題 | ||||
| 主題 | 主題作者 | 討論版 | 回覆 | 最後發表 |
| visual basic,C++和java | my God | -- 閒 話 家 常 灌 水 版 | 6 | 2004-04-09 06:05 PM |
| 【求助】推薦幾本Visual Basic 6的書 | kuanying | -- 閒 話 家 常 灌 水 版 | 6 | 2003-10-18 12:34 PM |
| Sniffer Basic v4.5 ?? | Allen Wang | -- 網 路 軟 體 討 論 二 版 (網路其他軟體) | 6 | 2003-07-04 02:41 PM |
| 【求助】Microsoft Visual Basic 之警告視窗,訊息為"此專案的巨集已被暫止,請參 | cchmark | -- OFFICE 相 關 軟 體 討 論 版 | 2 | 2002-09-11 03:43 PM |
| 有關Visual basic 6.0 | e-wei | -- HELP ME 電 腦 軟 硬 體 急 救 版 | 1 | 2002-02-14 07:03 PM |
| XML | RSS 2.0 | RSS |
本論壇所有文章僅代表留言者個人意見,並不代表本站之立場,討論區以「即時留言」方式運作,故無法完全監察所有即時留言,若您發現文章可能有異議,請 email :[email protected] 處理。