Results 1 to 11 of 11

Thread: help

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    20

    Talking

    how do i use the arrows to move a picture??

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Check out the demo page on my website. There's a DInput example where you can learn how to directly access the keyboard.

  3. #3
    Guest
    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]

  4. #4
    Guest
    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

  5. #5
    Guest
    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.


  6. #6
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Ditto

    Some of the best demos Ive downloaded

  7. #7
    Guest
    Well, he could just link the actual files instad of having to go through the webpage first. That would be easier.

  8. #8
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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?

  9. #9
    Guest
    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.

  10. #10
    Guest
    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!!)

  11. #11
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width