您好,現(xiàn)在冰冰來為大家解答以上的問題。vb小程序設(shè)計(jì)實(shí)例,vb小程序設(shè)計(jì)實(shí)例相信很多小伙伴還不知道,現(xiàn)在讓我們一起來看看吧!
1、先自己畫控件。
2、參照?qǐng)D片里面的不能有錯(cuò)注意左邊框架里面還有一個(gè)標(biāo)簽不要忘記!!Private?Sub?Command1_Click()RandomizeDim?a%,?b%,?c%,?cr%cr?=?Int(3?*?Rnd?+?1)If?cr?=?1?ThenLabel1.Caption?=?"石頭"ElseIf?cr?=?2?ThenLabel1.Caption?=?"剪刀"ElseIf?cr?=?3?ThenLabel1.Caption?=?"布"End?IfIf?cr?=?1?And?Option1.Value?=?True?Then?MsgBox?("平")If?cr?=?1?And?Option2.Value?=?True?Then?MsgBox?("You?Lost")If?cr?=?1?And?Option3.Value?=?True?Then?MsgBox?("You?Win!")If?cr?=?2?And?Option1.Value?=?True?Then?MsgBox?("You?Win!")If?cr?=?2?And?Option2.Value?=?True?Then?MsgBox?("平")If?cr?=?2?And?Option3.Value?=?True?Then?MsgBox?("You?Lost")If?cr?=?3?And?Option1.Value?=?True?Then?MsgBox?("You?Lost")If?cr?=?3?And?Option2.Value?=?True?Then?MsgBox?("You?Win!")If?cr?=?3?And?Option3.Value?=?True?Then?MsgBox?("平")End?SubPrivate?Sub?Command2_Click()Unload?Form1End?SubPrivate?Sub?Label3_Click()End?SubPrivate?Sub?Command3_Click()MsgBox?("You?Win!"?&?w?&?Chr(13)?&?"You?Lost"?&?l?&?Chr(13)?&?"平"?&?p)End?SubPrivate?Sub?Form_Load()Label1.FontSize?=?65End?SubPrivate?Sub?Option1_Click()Command1.SetFocusEnd?SubPrivate?Sub?Option2_Click()Command1.SetFocusEnd?SubPrivate?Sub?Option3_Click()Command1.SetFocusEnd?Sub?雖然寫的不是很簡潔。
3、不過也還OK啦?呵呵。
本文就為大家分享到這里,希望小伙伴們會(huì)喜歡。