Click here to Skip to main content

Visual Basic

 
QuestionDLL Question PinmemberNo-e29-Jun-12 6:26 
GeneralRe: DLL Question PinmvpDave Kreskowiak29-Jun-12 7:48 
AnswerRe: DLL Question PinmvpLuc Pattyn29-Jun-12 8:12 
Questiontrojans? PinmemberNo-e28-Jun-12 9:40 
AnswerRe: trojans? PinmemberWes Aday28-Jun-12 11:35 
GeneralRe: trojans? PinmvpAbhinav S28-Jun-12 18:36 
AnswerRe: trojans? PinmemberBernhard Hiller28-Jun-12 22:16 
GeneralRe: trojans? PinmemberNo-e29-Jun-12 6:19 
QuestionEvent on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad28-Jun-12 8:14 
AnswerRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten29-Jun-12 2:06 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad29-Jun-12 2:44 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten29-Jun-12 2:54 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad29-Jun-12 3:03 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten29-Jun-12 3:54 
Oke started a little project to test a bit around and i think you might find this interesting. i used a form called form1. and placed a listbox on it i called txtscroll.

I suggest you make a same sort of window and paste the following code in to see how it works:

Public Class Form1
 
    Dim WithEvents scrollhandler As MyListener 'class that will watch windows to see if your scrolling
    Private scrolled As Boolean = False 'boolean you can use to flip if a message box was displayed or not...(so it wont loop the messagebox.show)

 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'some random loop i used to ditch some data in my listbox for testing
        Dim index As Int32 = 0
        Do While index < 100
            txtscroll.Items.Add(index.ToString())
            index += 1
        Loop
 
        'attach your scrollwatcher to your control. in my case i have a listbox called "txtscroll")
        scrollhandler = New MyListener(txtscroll)
 
    End Sub
 
    Private Sub scrollhandler_MyScroll(ByVal sender As Object, ByVal e As System.EventArgs) Handles scrollhandler.MyScroll
        'place your if/else statement here, its smart to use the scrolled boolean to flip true/false so the messagebox doesnt go on a loop
    End Sub
 
    Private Sub txtscroll_MouseWheelScroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtscroll.MouseWheel
        scrollhandler_MyScroll(e, e) 'needed to catch the scrollwheel event.
    End Sub
 

    Private Class MyListener
        Inherits NativeWindow
 
        Public Event MyScroll(ByVal sender As Object, ByVal e As EventArgs)
        Const WM_MOUSEACTIVATE = &H21
        Const WM_MOUSEMOVE = &H200
        Private control As Control
 
        Public Sub New(ByVal control As Control)
            AssignHandle(control.Handle) 'docks handler to given control
        End Sub
 
        Protected Overrides Sub WndProc(ByRef Messageevent As Message)
            Const WM_HSCROLL = &H114
            Const WM_VSCROLL = &H115
            If Messageevent.Msg = WM_HSCROLL Or Messageevent.Msg = WM_VSCROLL Then 'looks if the horisontal or verticle scrollbar is moving
                'one of the scrollbars is moving, throw event
                RaiseEvent MyScroll(control, New EventArgs)
            End If
            MyBase.WndProc(Messageevent)
        End Sub
 
        Protected Overrides Sub Finalize()
            'not used in example but drops the scroll watcher
            ReleaseHandle()
            MyBase.Finalize()
        End Sub
 
    End Class
 

End Class

GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad29-Jun-12 9:27 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel [modified] PinmemberNick Otten1-Jul-12 22:37 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad2-Jul-12 14:29 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten2-Jul-12 21:36 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad3-Jul-12 0:57 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten3-Jul-12 1:16 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad3-Jul-12 14:36 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten4-Jul-12 2:01 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad6-Jul-12 14:24 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten8-Jul-12 21:38 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad10-Jul-12 3:32 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten10-Jul-12 4:13 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad10-Jul-12 16:15 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten10-Jul-12 21:41 
AnswerRe: Event on Scrolling to the end in flowlayoutpanel PinmvpLuc Pattyn29-Jun-12 3:56 
JokeRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten29-Jun-12 4:01 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmvpLuc Pattyn29-Jun-12 5:19 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberNick Otten29-Jun-12 5:31 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad29-Jun-12 9:28 
AnswerRe: Event on Scrolling to the end in flowlayoutpanel PinmvpLuc Pattyn29-Jun-12 10:00 
GeneralRe: Event on Scrolling to the end in flowlayoutpanel PinmemberAmmar_Ahmad30-Jun-12 1:08 
QuestionHelp for FTP client upload Pinmembermikrophun27-Jun-12 22:01 
AnswerRe: Help for FTP client upload PinmemberBernhard Hiller27-Jun-12 22:37 
GeneralRe: Help for FTP client upload Pinmembermikrophun27-Jun-12 22:42 
GeneralRe: Help for FTP client upload Pinmembermikrophun27-Jun-12 23:27 
AnswerRe: Help for FTP client upload PinmemberEddy Vluggen28-Jun-12 2:55 
AnswerRe: Help for FTP client upload Pinmembermikrophun28-Jun-12 18:40 
QuestionBasic program, very basic code, but still error, why!. [rich text box] PinmemberStudent1023027-Jun-12 21:55 
AnswerRe: Basic program, very basic code, but still error, why!. [rich text box] PinmemberBernhard Hiller27-Jun-12 22:39 
GeneralRe: Basic program, very basic code, but still error, why!. [rich text box] PinmemberStudent1023028-Jun-12 0:33 
GeneralRe: Basic program, very basic code, but still error, why!. [rich text box] PinmvpDave Kreskowiak28-Jun-12 2:48 
AnswerRe: Basic program, very basic code, but still error, why!. [rich text box] PinmemberEddy Vluggen28-Jun-12 2:49 
GeneralRe: Basic program, very basic code, but still error, why!. [rich text box] PinmvpDave Kreskowiak28-Jun-12 4:25 
GeneralRe: Basic program, very basic code, but still error, why!. [rich text box] PinmemberEddy Vluggen28-Jun-12 4:30 
GeneralRe: Basic program, very basic code, but still error, why!. [rich text box] PinmvpLuc Pattyn28-Jun-12 6:07 
GeneralRe: Basic program, very basic code, but still error, why!. [rich text box] PinmemberEddy Vluggen28-Jun-12 9:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150414.1 | Last Updated 19 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid