(資料圖片僅供參考)

1、先自己畫(huà)控件。

2、參照?qǐng)D片里面的不能有錯(cuò)注意左邊框架里面還有一個(gè)標(biāo)簽不要忘記!!PrivateSubCommand1_Click()RandomizeDima%,b%,c%,cr%cr=Int(3*Rnd+1)Ifcr=1ThenLabel1.Caption="石頭"ElseIfcr=2ThenLabel1.Caption="剪刀"ElseIfcr=3ThenLabel1.Caption="布"EndIfIfcr=1AndOption1.Value=TrueThenMsgBox("平")Ifcr=1AndOption2.Value=TrueThenMsgBox("YouLost")Ifcr=1AndOption3.Value=TrueThenMsgBox("YouWin!")Ifcr=2AndOption1.Value=TrueThenMsgBox("YouWin!")Ifcr=2AndOption2.Value=TrueThenMsgBox("平")Ifcr=2AndOption3.Value=TrueThenMsgBox("YouLost")Ifcr=3AndOption1.Value=TrueThenMsgBox("YouLost")Ifcr=3AndOption2.Value=TrueThenMsgBox("YouWin!")Ifcr=3AndOption3.Value=TrueThenMsgBox("平")EndSubPrivateSubCommand2_Click()UnloadForm1EndSubPrivateSubLabel3_Click()EndSubPrivateSubCommand3_Click()MsgBox("YouWin!"&w&Chr(13)&"YouLost"&l&Chr(13)&"平"&p)EndSubPrivateSubForm_Load()Label1.FontSize=65EndSubPrivateSubOption1_Click()Command1.SetFocusEndSubPrivateSubOption2_Click()Command1.SetFocusEndSubPrivateSubOption3_Click()Command1.SetFocusEndSub雖然寫(xiě)的不是很簡(jiǎn)潔。

3、不過(guò)也還OK啦呵呵。

本文到此分享完畢,希望對(duì)大家有所幫助。

標(biāo)簽: