爱问知识人 爱问教育 医院库

vb按钮的问题

首页

vb按钮的问题

你好,
假设我要设置5个本身为0的按钮,
假设按钮本身为0,当按下按钮后0变成1,当再次按下后变成2,直到变成4.
然后我想再设置一个新的按钮(总开关~),无论先前的几个按钮显示的数字是几,当按下新的按钮后,先前按钮上的数字都变成0.(还有5个按钮都是独立操作的,不能按一下一个按钮,其他的按钮上的数字也跟着变)
谢谢

提交回答
好评回答
  • 2018-04-02 08:32:32
      实现你功能的代码如下:
    Private Sub Command1_Click()
    If Command1。Caption = 0 Then Command1。Caption = 1: Exit Sub
    If Command1。Caption = 1 Then Command1。
      Caption = 2: Exit Sub If Command1。Caption = 2 Then Command1。Caption = 3: Exit Sub If Command1。Caption = 3 Then Command1。
      Caption = 4: Exit Sub If Command1。Caption = 4 Then Command1。Caption = 0 End Sub Private Sub Command2_Click() If Command2。
      Caption = 0 Then Command2。Caption = 1: Exit Sub If Command2。Caption = 1 Then Command2。Caption = 2: Exit Sub If Command2。
      Caption = 2 Then Command2。Caption = 3: Exit Sub If Command2。Caption = 3 Then Command2。Caption = 4: Exit Sub If Command2。
      Caption = 4 Then Command2。Caption = 0 End Sub Private Sub Command3_Click() If Command3。Caption = 0 Then Command3。Caption = 1: Exit Sub If Command3。
      Caption = 1 Then Command3。Caption = 2: Exit Sub If Command3。Caption = 2 Then Command3。Caption = 3: Exit Sub If Command3。
      Caption = 3 Then Command3。Caption = 4: Exit Sub If Command3。Caption = 4 Then Command3。Caption = 0 End Sub Private Sub Command4_Click() If Command4。
      Caption = 0 Then Command4。Caption = 1: Exit Sub If Command4。Caption = 1 Then Command4。Caption = 2: Exit Sub If Command4。
      Caption = 2 Then Command4。Caption = 3: Exit Sub If Command4。Caption = 3 Then Command4。Caption = 4: Exit Sub If Command4。
      Caption = 4 Then Command4。Caption = 0 End Sub Private Sub Command5_Click() If Command5。Caption = 0 Then Command5。Caption = 1: Exit Sub If Command5。
      Caption = 1 Then Command5。Caption = 2: Exit Sub If Command5。Caption = 2 Then Command5。Caption = 3: Exit Sub If Command5。
      Caption = 3 Then Command5。Caption = 4: Exit Sub If Command5。Caption = 4 Then Command5。Caption = 0 End Sub Private Sub Command6_Click() Command1。
      Caption = 0 Command2。Caption = 0 Command3。Caption = 0 Command4。Caption = 0 Command5。Caption = 0 End Sub 。

    久***

    2018-04-02 08:32:32

类似问题

换一换
  • 软件 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新资料 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):