vb小程序设计实例(vb小程序设计实例)

时间:2022-09-16 15:35:32来源:
导读您好,现在冰冰来为大家解答以上的问题。vb小程序设计实例,vb小程序设计实例相信很多小伙伴还不知道,现在让我们一起来看看吧!1、先自己画...

您好,现在冰冰来为大家解答以上的问题。vb小程序设计实例,vb小程序设计实例相信很多小伙伴还不知道,现在让我们一起来看看吧!

1、先自己画控件。

2、参照图片里面的不能有错注意左边框架里面还有一个标签不要忘记!!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啦 呵呵。

本文就为大家分享到这里,希望小伙伴们会喜欢。

标签:
最新文章