首页 > 百科知识 > 正文

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

来源:百科知识2023-03-06 11:06:40
导读 您好,今天蔡哥来为大家解答以上的问题。vb小程序,vb小程序设计实例相信很多小伙伴还不知道,现在让我们一起来看看吧!1、先自己画控件。2、

您好,今天蔡哥来为大家解答以上的问题。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啦 呵呵。

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

关键词:
版权声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。

猜你喜欢

最新文章