none
Help with mousemove event RRS feed

  • Question

  • The below code snippet is form VB6 of MouseMove event. How can I do the same in VB.net. any help would be appreciated.

    Private Sub cmdIOSvrMsg_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)

    ' Dim sQueueName As String

    Dim oSvr As CIOServer Set oSvr = m_IOServers.Item(str(Index))  

    oSvr.RequestNDSTransaction

    Set oSvr = Nothing End Sub

    Tuesday, May 8, 2018 8:26 PM

All replies

  • I'm not sure what the index and button arguments were for, but every control will have its own MouseMove event in .Net.  You will just need to handle the mouse move event for whatever control you are working with.

    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Tuesday, May 8, 2018 8:29 PM
    Moderator
  • That code looks strange. Mouse move in .Net is not going to return an index, button or shift.

    MouseDown will return a button. I suppose it's possible that a mouse move on some control that has rows and columns or perhaps a ListBox could return an index somehow. No idea what shift means.

    MouseMove will return mouseventargs which will have x and y coordinates.

    Private Sub cmdIOSvrMsg_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)

    Also see Control.MouseMove Event


    La vida loca

    • Proposed as answer by Cor Ligthert Tuesday, May 8, 2018 9:37 PM
    Tuesday, May 8, 2018 9:09 PM
  • control will have  

    I started this reply as one little message as a reminder to Reed, but it did grow :-)

    However, controls can have its own handler but more controls can share the same event , for instance with a Select Case like was in windows forms of Visual Studio 6 (1998) and was done using the index of the build in control array for every control type of forms . Currently one control can also handle more events which was not yet in version 6. 

    Controls is now always a collection in windows forms since visual studio 2002.

    But mostly there is only one mouse. 

    To avoid misunderstandings.

    :-)


    Success
    Cor




    Tuesday, May 8, 2018 9:19 PM