Click to See Complete Forum and Search --> : help
tonyp
May 25th, 2000, 10:49 PM
how do i use the arrows to move a picture??
Fox
May 26th, 2000, 06:13 AM
Check out the demo page on my website (http://foxmccloud.tsx.org). There's a DInput example where you can learn how to directly access the keyboard. :)
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]
You can also use the GetAsyncKeyState API. This will enable you to use multiple KeyDown's as well.
Code for module.
Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Code for a Timer
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
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 :D
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.
SteveCRM
Jun 5th, 2000, 02:38 AM
Some of the best demos Ive downloaded :)
Well, he could just link the actual files instad of having to go through the webpage first. That would be easier.
Fox
Jun 5th, 2000, 04:50 AM
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? ;)
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.
that is so easy fox...
I am sure you could do it.. because you rule :D
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
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
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 :D
for me, I can give it to you if you want.. fox. or anybody else(source code included, yay!!)
Fox
Jun 5th, 2000, 05:46 PM
Uh, I just sleeped one night and you come up with this code... sorry mate but the program's already written ;) I call it nTray and it holds eMail adresses, website URLs and stuff. It's a tray icon like ICQ you can click, then a menu appears where you can select an item (ie. "DDraw demo"). The program copies the value of this item in the clipboard so you can easy use it's text (ie. "http://orion.spaceports.com/mccloud/coding/res/ddraw.zip").
Nice that you want to help me but that was _too_ easy :)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.