VERSION 5.00 Begin VB.Form Form1 Caption = "四捨五入のサンプル" ClientHeight = 1965 ClientLeft = 60 ClientTop = 345 ClientWidth = 4155 LinkTopic = "Form1" ScaleHeight = 1965 ScaleWidth = 4155 StartUpPosition = 3 'Windows の既定値 Begin VB.CommandButton Command1 Caption = "結果" Height = 255 Left = 2640 TabIndex = 4 Top = 1200 Width = 615 End Begin VB.TextBox Text1 Height = 270 Left = 1080 TabIndex = 0 Top = 1200 Width = 1215 End Begin VB.Label Label3 Caption = "BY MADIA" Height = 180 Left = 3000 TabIndex = 3 Top = 1680 Width = 990 End Begin VB.Label Label2 Caption = "小数点付きの整数を入力して下さい" Height = 180 Left = 600 TabIndex = 2 Top = 720 Width = 2700 End Begin VB.Label Label1 Caption = "< 四捨五入のサンプルプログラムです >" Height = 180 Left = 360 TabIndex = 1 Top = 240 Width = 3330 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub Command1_Click() Dim KEKKA As Integer Dim MSG As String KEKKA = Int(Text1.Text + 0.5) MSG = Val(Text1.Text) & " の四捨五入の結果は " & KEKKA & " です" MsgBox MSG End Sub