|
-
Oct 2nd, 2000, 06:43 PM
#1
Thread Starter
Lively Member
ok, three very simple questions.
How can I check to see if a button is being held down?
I'm trying to increment a number when a button is pressed. How can I continue to increment that number if a button is pressed and held?
I'm also looking for some examples of pseudo-3d code. I understand this isn't assembly, but there has to be some examples out there. Vector examples or something.
Is it possible to change a PictureBox image?
-
Oct 2nd, 2000, 06:52 PM
#2
_______
<?>
[code]
1. Forget it how would you know how many to increment
2. Don't know
3. Yes....
Set Picture1.Picture = LoadPicture("C:\myfile.jpg")
[code]
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Oct 2nd, 2000, 08:06 PM
#3
Lively Member
Use the UpDown control
Can you use an UpDown control? Try this on a sample project and see if it will work for you. Its in the common controls.
Code:
Option Explicit
Dim iNum As Integer
Private Sub Form_Load()
iNum = 10
Text1.Text = iNum
End Sub
Private Sub UpDown1_DownClick()
iNum = iNum - 1
Text1.Text = iNum
End Sub
Private Sub UpDown1_UpClick()
iNum = iNum + 1
Text1.Text = iNum
End Sub
-
Oct 2nd, 2000, 08:30 PM
#4
Lively Member
Better
You want it to imcrement while its held down, don't you? Start a project, put 2 Command buttons, cmdUp and cmdDown. Put 2 timers tmr Up and tmrDown and Text box Text1. Paste in this code and see if it does what you want.
Code:
Dim iNum As Integer
Private Sub cmdUp_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
tmrUp.Enabled = True
End Sub
Private Sub cmdUp_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
tmrUp.Enabled = False
End Sub
Private Sub Form_Load()
iNum = 10
Text1.Text = iNum
tmrUp.Interval = 100
tmrDown.Interval = 100
tmrUp.Enabled = False
tmrDown.Enabled = False
End Sub
Private Sub tmrDown_Timer()
iNum = iNum - 1
Text1.Text = iNum
End Sub
Private Sub tmrUp_Timer()
iNum = iNum + 1
Text1.Text = iNum
End Sub
Private Sub cmdDown_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
tmrDown.Enabled = False
End Sub
Private Sub cmdDown_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
tmrDown.Enabled = True
End Sub
I think this will do what you want.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|