コマンドを押しているときだけ実行するもの誰か知りませんか??
意味不明です。
コマンドってのはコマンドボタンのこと?
押してる時ってのは押しっぱなしってこと??
実行するって何を???
こういうこと?
--- From1.frm ----
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 450
ClientLeft = 1800
ClientTop = 1530
ClientWidth = 6060
LinkTopic = "Form1"
ScaleHeight = 450
ScaleWidth = 6060
Begin VB.TextBox Text1
Height = 405
Left = 0
TabIndex = 1
Text = "0"
Top = 0
Width = 2565
End
Begin VB.CommandButton Command1
Caption = "押した時だけ"
Height = 435
Left = 2580
TabIndex = 0
Top = 0
Width = 3465
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 100
Left = 1740
Top = 30
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_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Timer1.Enabled = True
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Me.Text1 = CLng(Me.Text1) + 1
End Sub
有難うございます。試してみます♪
もげさん有難うございます。出来ました(^^)
ツイート | ![]() |