您的位置:首页 > 编程语言 > VB

比较两个数的大小

2012-04-28 19:37 267 查看
VERSION 5.00

Begin VB.Form Form1

   ClientHeight    =   3870

   ClientLeft      =   60

   ClientTop       =   345

   ClientWidth     =   6045

   LinkTopic       =   "Form1"

   ScaleHeight     =   3870

   ScaleWidth      =   6045

   StartUpPosition =   3  '窗口缺省

   Begin VB.CommandButton Command1

      Caption         =   "比较"

      Height          =   735

      Left            =   1080

      TabIndex        =   6

      Top             =   1920

      Width           =   1575

   End

   Begin VB.TextBox Text2

      Height          =   615

      Left            =   2280

      TabIndex        =   3

      Top             =   960

      Width           =   1095

   End

   Begin VB.TextBox Text1

      Height          =   495

      Left            =   360

      TabIndex        =   2

      Top             =   960

      Width           =   735

   End

   Begin VB.Label Label4

      Caption         =   "N"

      Height          =   495

      Left            =   1680

      TabIndex        =   5

      Top             =   1080

      Width           =   495

   End

   Begin VB.Label Label3

      Caption         =   "M"

      Height          =   375

      Left            =   120

      TabIndex        =   4

      Top             =   1080

      Width           =   135

   End

   Begin VB.Label Label2

      Height          =   375

      Left            =   3120

      TabIndex        =   1

      Top             =   240

      Width           =   855

   End

   Begin VB.Label Label1

      Caption         =   "实现两个数大小的比较,写出最大值"

      Height          =   375

      Left            =   240

      TabIndex        =   0

      Top             =   240

      Width           =   2535

   End

End

Attribute VB_Name = "Form1"

Attribute VB_GlobalNameSpace = False

Attribute VB_Creatable = False

Attribute VB_PredeclaredId = True

Attribute VB_Exposed = False

Private Sub Command1_Click()

Dim M As Integer

Dim N As Integer

M = Val(Text1.Text)

N = Val(Text2.Text)

If M > N Then

Print M

Else

Print N

End If

End Sub
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vb command 360