(資料圖片僅供參考)
1、先自己畫控件。
2、參照圖片里面的不能有錯注意左邊框架里面還有一個標簽不要忘記!!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雖然寫的不是很簡潔。
3、不過也還OK啦呵呵。
本文到此分享完畢,希望對大家有所幫助。
標簽: