Results 1 to 5 of 5

Thread: Mouse stuff???

  1. #1
    Guest
    I think he is talking about using it on a text box or something. I think you would have to use SendMessage to do that.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Put a textbox and a commandbutton onto a form. Then add this code:
    Code:
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Const EM_SCROLL = &HB5
    Const SB_LINEDOWN = 1
    Const SB_LINEUP = 0
    Const SB_PAGEDOWN = 3
    Const SB_PAGEUP = 2
    Private Sub Command1_Click()
        SendMessage Text1.hwnd, EM_SCROLL, SB_LINEDOWN, 0
    End Sub
    Private Sub Form_Load()
        For i = 1 To 50
            Text1.Text = Text1.Text + vbCrLf + "here is some particularly useful text being used as an example."
        Next i
    End Sub
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    And here's how you'd do that...

    Code:
    Private Declare Function SendMessage Lib "user32" _  Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As _  Long, ByVal wParam As Long, lParam As Any) As Long
    
    Private Const SB_LINEDOWN = 1
    Private Const SB_LINEUP = 0
    
    Private Const EM_SCROLL = &HB5
    
    Private Sub cmdScrollUp_Click()
    Call SendMessage(Text1.hWnd, EM_SCROLL, SB_LINEUP, 0)
    End Sub
    
    Private Sub cmdScrollDown_Click()
    Call SendMessage(Text1.hWnd, EM_SCROLL, SB_LINEUP, 0)
    End Sub
    I haven't tested it, but I'm pretty sure it'll work.

    Le one and only moi.





    Courgettes.

  4. #4
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516

    Angry

    That's the second time you've beaten me to it in this thread...

    Grrrr.

    I'll have to neutralise the threat.

    I know where you live...almost
    Courgettes.

  5. #5
    Lively Member quadoc's Avatar
    Join Date
    Jan 1999
    Location
    Ga, USA
    Posts
    83

    Smile

    I will try those tips. Thanks alot everyone!!!
    VB6(SP4), QB4.5, PDS7.0, IBM-U2

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