Home All Groups Group Topic Archive Search About

How to make double click event to call and execute the mouseup event code

Author
25 Aug 2006 3:23 AM
techsatish
Hi,

I want the double click event to call(here not able to get the
MouseEventArgs)  and execute the mouseup event code or any one tell me
how to make my treecontrol double click nodes to behave like a singe
click event(that is mouseup here)so that that will fire mouseup.How can
i implement this?any ideas ? code snippets?

Thanks in advance
satish

Here is the code.Consider these event handing code are inside a
usercontrol class.The tree control used here is infragistics tree
control.


Public Class ucNavigationTree
        Inherits System.Windows.Forms.UserControl

Private Sub TreeView1_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseUp
            Dim pt As New Point(e.X, e.Y)
            Dim clickedCtrl As TreeNode = TreeView1.GetNodeAt(pt)

            If clickedCtrl Is Nothing OrElse clickedCtrl.Tag Is Nothing
Then Exit Sub

            TreeView1.SelectedNode = TreeView1.GetNodeAt(New Point(e.X,
e.Y))

            Try

                If e.Button = MouseButtons.Left Then
                    Cursor.Current = Cursors.AppStarting
                    ActivateViewer(TreeView1.SelectedNode, False)

                ElseIf e.Button = MouseButtons.Right Then
                    Dim mnu As ContextMenu
                    ' display popup from attached tag
                    If TypeOf clickedCtrl.Tag Is
UserManagementDataSet.entitiesRow Then
                        mnu = MenuOpenOption
                        If Not mnu Is Nothing Then mnu.Show(TreeView1,
pt)
                    End If
                End If

            Finally
                Cursor.Current = Cursors.Default
            End Try
            Debug.WriteLine("The Count is :" + counter.ToString)
        End Sub


  Private Sub TreeView1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TreeView1.DoubleClick

        End Sub

End Class

Author
25 Aug 2006 4:07 PM
tomb
Put the event code in a private function, then call the function from
the doubleclick event.

T

techsat***@gmail.com wrote:

Show quoteHide quote
>
>Hi,
>
>I want the double click event to call(here not able to get the
>MouseEventArgs)  and execute the mouseup event code or any one tell me
>how to make my treecontrol double click nodes to behave like a singe
>click event(that is mouseup here)so that that will fire mouseup.How can
>i implement this?any ideas ? code snippets?
>
>Thanks in advance
>satish
>
>Here is the code.Consider these event handing code are inside a
>usercontrol class.The tree control used here is infragistics tree
>control.
>
>
>Public Class ucNavigationTree
>        Inherits System.Windows.Forms.UserControl
>
>Private Sub TreeView1_MouseUp(ByVal sender As Object, ByVal e As
>System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseUp
>            Dim pt As New Point(e.X, e.Y)
>            Dim clickedCtrl As TreeNode = TreeView1.GetNodeAt(pt)
>
>            If clickedCtrl Is Nothing OrElse clickedCtrl.Tag Is Nothing
>Then Exit Sub
>
>            TreeView1.SelectedNode = TreeView1.GetNodeAt(New Point(e.X,
>e.Y))
>
>            Try
>
>                If e.Button = MouseButtons.Left Then
>                    Cursor.Current = Cursors.AppStarting
>                    ActivateViewer(TreeView1.SelectedNode, False)
>
>                ElseIf e.Button = MouseButtons.Right Then
>                    Dim mnu As ContextMenu
>                    ' display popup from attached tag
>                    If TypeOf clickedCtrl.Tag Is
>UserManagementDataSet.entitiesRow Then
>                        mnu = MenuOpenOption
>                        If Not mnu Is Nothing Then mnu.Show(TreeView1,
>pt)
>                    End If
>                End If
>
>            Finally
>                Cursor.Current = Cursors.Default
>            End Try
>            Debug.WriteLine("The Count is :" + counter.ToString)
>        End Sub
>
>
>  Private Sub TreeView1_DoubleClick(ByVal sender As Object, ByVal e As
>System.EventArgs) Handles TreeView1.DoubleClick
>             
>        End Sub
>
>End Class
>

>
Author
25 Aug 2006 4:43 PM
Techsatish
But how will  pass my mouse cursor postion and the mouse event args to
the double click event...argument for double click has System.EventArgs
which does to accept this?!



tomb wrote:
Show quoteHide quote
> Put the event code in a private function, then call the function from
> the doubleclick event.
>
> T
>
> techsat***@gmail.com wrote:
>
> >
> >Hi,
> >
> >I want the double click event to call(here not able to get the
> >MouseEventArgs)  and execute the mouseup event code or any one tell me
> >how to make my treecontrol double click nodes to behave like a singe
> >click event(that is mouseup here)so that that will fire mouseup.How can
> >i implement this?any ideas ? code snippets?
> >
> >Thanks in advance
> >satish
> >
> >Here is the code.Consider these event handing code are inside a
> >usercontrol class.The tree control used here is infragistics tree
> >control.
> >
> >
> >Public Class ucNavigationTree
> >        Inherits System.Windows.Forms.UserControl
> >
> >Private Sub TreeView1_MouseUp(ByVal sender As Object, ByVal e As
> >System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseUp
> >            Dim pt As New Point(e.X, e.Y)
> >            Dim clickedCtrl As TreeNode = TreeView1.GetNodeAt(pt)
> >
> >            If clickedCtrl Is Nothing OrElse clickedCtrl.Tag Is Nothing
> >Then Exit Sub
> >
> >            TreeView1.SelectedNode = TreeView1.GetNodeAt(New Point(e.X,
> >e.Y))
> >
> >            Try
> >
> >                If e.Button = MouseButtons.Left Then
> >                    Cursor.Current = Cursors.AppStarting
> >                    ActivateViewer(TreeView1.SelectedNode, False)
> >
> >                ElseIf e.Button = MouseButtons.Right Then
> >                    Dim mnu As ContextMenu
> >                    ' display popup from attached tag
> >                    If TypeOf clickedCtrl.Tag Is
> >UserManagementDataSet.entitiesRow Then
> >                        mnu = MenuOpenOption
> >                        If Not mnu Is Nothing Then mnu.Show(TreeView1,
> >pt)
> >                    End If
> >                End If
> >
> >            Finally
> >                Cursor.Current = Cursors.Default
> >            End Try
> >            Debug.WriteLine("The Count is :" + counter.ToString)
> >        End Sub
> >
> >
> >  Private Sub TreeView1_DoubleClick(ByVal sender As Object, ByVal e As
> >System.EventArgs) Handles TreeView1.DoubleClick
> >             
> >        End Sub
> >
> >End Class
> >
> > 
> >