VB6 and mouse - basic.visual

This is a discussion on VB6 and mouse - basic.visual ; Hello, I would like (using VB6), to take an action, 1 - When the mouse fly on my form (without click) and take another action: 2- When the mouse leave my form (without click). I found Form/MouseMove for the first ...

+ Reply to Thread
Results 1 to 7 of 7

VB6 and mouse

  1. Default VB6 and mouse

    Hello,
    I would like (using VB6), to take an action,
    1 - When the mouse fly on my form (without click)
    and take another action:
    2- When the mouse leave my form (without click).
    I found Form/MouseMove for the first action (action 1), but cant find the
    event for the second action (action 2).
    Anyone to help me ??
    Many thanks for your answer.
    Regards.





  2. Default Re: VB6 and mouse

    On Thu, 25 Jan 2007 23:00:54 +0100, "Dudule" <nivu@niconnu.com> wrote:

    >Hello,
    >I would like (using VB6), to take an action,
    >1 - When the mouse fly on my form (without click)
    >and take another action:
    >2- When the mouse leave my form (without click).
    >I found Form/MouseMove for the first action (action 1), but cant find the
    >event for the second action (action 2).
    >Anyone to help me ??


    I've only ever seen MouseOver implemented for controls, not the form,
    but this might point you in the right direction
    http://www.codeproject.com/useritems...eave_Hover.asp
    --
    Alfie [UK]
    <http://www.delphia.co.uk/>
    Isn't having a smoking section in a restaurant like having a peeing section in a swimming pool?


  3. Default Re: VB6 and mouse

    Dudule wrote:
    >
    > Hello,
    > I would like (using VB6), to take an action,
    > 1 - When the mouse fly on my form (without click)
    > and take another action:
    > 2- When the mouse leave my form (without click).
    > I found Form/MouseMove for the first action (action 1), but cant find the
    > event for the second action (action 2).
    > Anyone to help me ??
    > Many thanks for your answer.
    > Regards.


    Can not help with number 2 but I have use the Form_MouseMove.

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As
    Single, Y As Single)
    Label7.Visible = False
    End Sub

  4. Default Re: VB6 and mouse

    On Thu, 25 Jan 2007 23:00:54 +0100, "Dudule" <nivu@niconnu.com> wrote:

    >Hello,
    >I would like (using VB6), to take an action,
    >1 - When the mouse fly on my form (without click)
    >and take another action:
    >2- When the mouse leave my form (without click).
    >I found Form/MouseMove for the first action (action 1), but cant find the
    >event for the second action (action 2).
    >Anyone to help me ??
    >Many thanks for your answer.


    Here is an interesting method :-

    Option Explicit

    ' Larry Seflaten Mouse Hover
    ' 11/7/05

    Private Sub Command1_DragDrop(Source As Control, X As Single, Y As
    Single)
    Command1.Drag vbEndDrag
    Command1.Caption = "Command1"
    Command1.SetFocus
    MsgBox "click"
    End Sub

    Private Sub Command1_DragOver(Source As Control, X As Single, Y As
    Single, State As Integer)
    If Source Is Command1 Then
    If State = vbLeave Then
    Command1.Drag vbEndDrag
    Command1.Caption = "Command1"
    End If
    End If
    End Sub

    Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X
    As Single, Y As Single)
    Command1.DragIcon = Icon ' use arrow icon
    Command1.Drag vbBeginDrag
    Command1.Caption = "Hovering"
    End Sub




  5. Default Re: VB6 and mouse


    "J French" <erewhon@nowhere.uk> wrote in message
    news:45b9ae44.1317078@news.btopenworld.com...
    > On Thu, 25 Jan 2007 23:00:54 +0100, "Dudule" <nivu@niconnu.com> wrote:
    >
    >
    > Here is an interesting method :-
    >
    > Option Explicit
    >
    > ' Larry Seflaten Mouse Hover
    > ' 11/7/05
    >


    Interesting, and fun to play with. Here is an adaptation of it, using a button
    as the drag object, but monitoring the form's events instead, to detect exiting
    the form. It will also "exit" when the mouse enters other controls on the form,
    allowing the controls to operate normally.

    Private Sub Form_Load()
    Command1.Visible = False
    Command1.Move 0, 0, 0, 0
    Command1.DragMode = 0
    End Sub

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y
    As Single)
    Command1.DragIcon = Me.MouseIcon
    Command1.Move X, Y
    Command1.Drag vbBeginDrag
    Me.Caption = "Entered"
    End Sub

    Private Sub Form_DragOver(Source As Control, X As Single, Y As Single, State As
    Integer)
    If Source Is Command1 And State = vbLeave Then
    Command1.Drag vbEndDrag
    Me.Caption = "Exited"
    End If
    End Sub



  6. Default Re: VB6 and mouse

    On Fri, 26 Jan 2007 00:21:42 -0800, "Steve Gerrard"
    <mynamehere@comcast.net> wrote:

    <snip>

    >Interesting, and fun to play with. Here is an adaptation of it, using a button
    >as the drag object, but monitoring the form's events instead, to detect exiting
    >the form. It will also "exit" when the mouse enters other controls on the form,
    >allowing the controls to operate normally.


    That is really good - it's added to my samples directory



  7. Default Re: VB6 and mouse

    Hello,
    Back to home, sorry.
    Superb Steve, I will use it, and keep it in my samples for later use...
    Many thanks to everybody, for all your suggestions and answers.
    Regards to all
    Jean

    "Steve Gerrard" <mynamehere@comcast.net> a écrit dans le message de news:
    qeednVxuVOkdJyTYnZ2dnUVZ_qarnZ2d@comcast.com...
    >
    > "J French" <erewhon@nowhere.uk> wrote in message
    > news:45b9ae44.1317078@news.btopenworld.com...
    >> On Thu, 25 Jan 2007 23:00:54 +0100, "Dudule" <nivu@niconnu.com> wrote:
    >>
    >>
    >> Here is an interesting method :-
    >>
    >> Option Explicit
    >>
    >> ' Larry Seflaten Mouse Hover
    >> ' 11/7/05
    >>

    >
    > Interesting, and fun to play with. Here is an adaptation of it, using a
    > button as the drag object, but monitoring the form's events instead, to
    > detect exiting the form. It will also "exit" when the mouse enters other
    > controls on the form, allowing the controls to operate normally.
    >
    > Private Sub Form_Load()
    > Command1.Visible = False
    > Command1.Move 0, 0, 0, 0
    > Command1.DragMode = 0
    > End Sub
    >
    > Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As
    > Single, Y As Single)
    > Command1.DragIcon = Me.MouseIcon
    > Command1.Move X, Y
    > Command1.Drag vbBeginDrag
    > Me.Caption = "Entered"
    > End Sub
    >
    > Private Sub Form_DragOver(Source As Control, X As Single, Y As Single,
    > State As Integer)
    > If Source Is Command1 And State = vbLeave Then
    > Command1.Drag vbEndDrag
    > Me.Caption = "Exited"
    > End If
    > End Sub
    >
    >





+ Reply to Thread

Similar Threads

  1. Change mouse icon to wait mouse icon
    By Application Development in forum xharbour
    Replies: 2
    Last Post: 10-21-2007, 05:46 PM
  2. Replies: 0
    Last Post: 10-08-2007, 02:10 AM
  3. Get a (gentle) grip on your mouse before itgets a (firm) grip on you(r mouse arm)
    By Application Development in forum Adobe illustrator
    Replies: 14
    Last Post: 05-17-2007, 04:06 PM
  4. Mouse Enter / Mouse Leave...
    By Application Development in forum basic.visual
    Replies: 7
    Last Post: 03-19-2007, 07:28 PM
  5. Re: Mouse move and mouse enter Events
    By Application Development in forum Graphics
    Replies: 3
    Last Post: 06-26-2003, 08:12 AM