|
-
May 25th, 2000, 10:49 PM
#1
Thread Starter
Junior Member
how do i use the arrows to move a picture??
-
May 26th, 2000, 06:13 AM
#2
PowerPoster
Check out the demo page on my website. There's a DInput example where you can learn how to directly access the keyboard.
-
May 26th, 2000, 07:16 AM
#3
hey,
fox, we all know how great your web site is...but stop telling people to go to it already! thats your answer to everything! go to my website. hey, as for your question:
try this:
first, click on the form and make sure the property "keypreview" is set to true. then
under the controls part, click "keydown" then put in the code:
code:
' to go right
if keycode = vbkeyright then
picture1.move picture1.left + 20 'or whatever speed you want
end if
' to go left
if keycode = vbkeyleft then
picture1.move picture1.left - 20
end if
[Edited by t_dawolf on 05-26-2000 at 08:20 PM]
-
May 30th, 2000, 08:08 AM
#4
You can also use the GetAsyncKeyState API. This will enable you to use multiple KeyDown's as well.
Code for module.
Code:
Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Code for a Timer
Code:
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyRight) Then Picture1.Left = Picture1.Left + 50
If GetAsyncKeyState(vbKeyLeft) Then Picture1.Left = Picture1.Left - 50
If GetAsyncKeyState(vbKeyUp) Then Picture1.Top = Picture1.Top - 50
If GetAsyncKeyState(vbKeyDown) Then Picture1.Top = Picture1.Top + 50
End Sub
-
Jun 4th, 2000, 10:58 AM
#5
t_dawolf
fox, we all know how great your web site is...but stop telling people to go to it already! thats your answer to everything! go to my website.
its his answer to everything because it IS the answer to everything 
if you dont want to, or dont know how to use dx, then download his bitblt sample, it gives a good sample on the arrow question.
-
Jun 5th, 2000, 02:38 AM
#6
Frenzied Member
Ditto
Some of the best demos Ive downloaded
-
Jun 5th, 2000, 02:47 AM
#7
Well, he could just link the actual files instad of having to go through the webpage first. That would be easier.
-
Jun 5th, 2000, 04:50 AM
#8
PowerPoster
I think I'll code a little program to hold these links so I'll link to the demos directly in the future, is that an offer?
-
Jun 5th, 2000, 06:11 AM
#9
Yeah, that's an offer. For some reason, when i think of looking through a webiste, I always have a picture in my mind of browsing for hours and hours for the thing I want...I guess I'm just a little lazy.
-
Jun 5th, 2000, 07:19 AM
#10
that is so easy fox...
I am sure you could do it.. because you rule 
but I would do it like this
1 cmd button, one listbox, 2 textboxes
it would be so easy,
for the command buttton do this
Code:
List1.AddItem("http://foxmccloudswebsite.com/vb/files/" & Text1.Text)
you type the name of the file in text1
IE
BitBlt.zip
the click the button. it will appear in the listbox.
then for the list box under doubleclick do this
Code:
Text2.Text = List1.Text
this wont store the stuff. you will have to store it in a textfile... which I know you know how to do. so I wont tell you(mainly because I am so lazy )
then you can read the urls from the text file and add them to the listbox...
if you wanted. you could make it so anybody could use it,
add another textbox, and then type the URL(http://yoururl.com/vb/files/) of the files directory. and then write that to another text file.
you can add another list box, and you can be able to acess the file names from different URLs
I think I will do something like that
for me, I can give it to you if you want.. fox. or anybody else(source code included, yay!!)
-
Jun 5th, 2000, 05:46 PM
#11
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
|