Single click stops double-click working?? Help??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Siv

    #1

    Single click stops double-click working?? Help??

    Hi,
    I have a ListView control in a Windows application, currently single
    clicking a customer name in this list, selects the customer and displays
    their details in text boxes to the right of the list. The user must then
    click a button to select that customer and move off the page to the main
    database details. I would like to implement being able to double-click the
    listview item and it have the same effect as single clicking and then
    pressing the button.

    My problem is that I can't get the double-click event to fire, the
    single-click always gets in first??

    How do I tell the control that if the two clicks are in close succession it
    is a double-click not two single clicks??

    I thought the system would go with the double-click if the clicks were
    within the timeframe specified in the control panel for a double-click??

    --
    Siv
    Martley, Near Worcester, UK.


  • Dave Cousineau ( Sahuagin )

    #2
    RE: Single click stops double-click working?? Help??

    i do exactly what you describe with pretty much all of my listview's, so it
    should work. are you using the DoubleClick event? you may also be doing
    something wierd inside MyListView_Clic k that prevents a DoubleClick from
    being generated

    Private Sub MyListView_Doub leClick(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles MyListView.Doub leClick
    On Error Resume Next
    MyButton_Click( sender, e)
    End Sub

    Private Sub MyButton_Click( ByVal sender As System.Object, ByVal e As
    System.EventArg s) Handles MyButton.Click
    'do stuff
    End Sub



    "Siv" wrote:
    [color=blue]
    > Hi,
    > I have a ListView control in a Windows application, currently single
    > clicking a customer name in this list, selects the customer and displays
    > their details in text boxes to the right of the list. The user must then
    > click a button to select that customer and move off the page to the main
    > database details. I would like to implement being able to double-click the
    > listview item and it have the same effect as single clicking and then
    > pressing the button.
    >
    > My problem is that I can't get the double-click event to fire, the
    > single-click always gets in first??
    >
    > How do I tell the control that if the two clicks are in close succession it
    > is a double-click not two single clicks??
    >
    > I thought the system would go with the double-click if the clicks were
    > within the timeframe specified in the control panel for a double-click??
    >
    > --
    > Siv
    > Martley, Near Worcester, UK.
    >
    >
    >[/color]

    Comment

    • Inge Henriksen

      #3
      Re: Single click stops double-click working?? Help??

      If you have trouble getting it to work, then try to bubble the event using:

      RaiseBubbleEven t(Me, e)


      "Dave Cousineau ( Sahuagin )"
      <DaveCousineauS ahuagin@discuss ions.microsoft. com> skrev i melding
      news:C5AD8E97-4F3A-4A04-AF5A-89C87A7DD1C8@mi crosoft.com...[color=blue]
      >i do exactly what you describe with pretty much all of my listview's, so it
      > should work. are you using the DoubleClick event? you may also be doing
      > something wierd inside MyListView_Clic k that prevents a DoubleClick from
      > being generated
      >
      > Private Sub MyListView_Doub leClick(ByVal sender As Object, ByVal e As
      > System.EventArg s) Handles MyListView.Doub leClick
      > On Error Resume Next
      > MyButton_Click( sender, e)
      > End Sub
      >
      > Private Sub MyButton_Click( ByVal sender As System.Object, ByVal e As
      > System.EventArg s) Handles MyButton.Click
      > 'do stuff
      > End Sub
      >
      >
      >
      > "Siv" wrote:
      >[color=green]
      >> Hi,
      >> I have a ListView control in a Windows application, currently single
      >> clicking a customer name in this list, selects the customer and displays
      >> their details in text boxes to the right of the list. The user must then
      >> click a button to select that customer and move off the page to the main
      >> database details. I would like to implement being able to double-click
      >> the
      >> listview item and it have the same effect as single clicking and then
      >> pressing the button.
      >>
      >> My problem is that I can't get the double-click event to fire, the
      >> single-click always gets in first??
      >>
      >> How do I tell the control that if the two clicks are in close succession
      >> it
      >> is a double-click not two single clicks??
      >>
      >> I thought the system would go with the double-click if the clicks were
      >> within the timeframe specified in the control panel for a double-click??
      >>
      >> --
      >> Siv
      >> Martley, Near Worcester, UK.
      >>
      >>
      >>[/color][/color]



      Comment

      • Inge Henriksen

        #4
        Re: Single click stops double-click working?? Help??

        Check that "Handles MyListView.Doub leClick" is attached to the appropriate
        function decleration. Some versions of the Visual Studio IDE sometimes
        creates event handlers without these "Handles" attached, thus the event will
        never be called.

        Example of usage:

        Private Sub MyListView_Doub leClick(ByVal sender As Object, ByVal e As
        System.EventArg s) Handles MyListView.Doub leClick
        MsgBox ("Hello world!")
        end sub


        "Siv" <msnewsgroups@r emoveme.sivill. com> skrev i melding
        news:upBks5WhFH A.3568@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Hi,
        > I have a ListView control in a Windows application, currently single
        > clicking a customer name in this list, selects the customer and displays
        > their details in text boxes to the right of the list. The user must then
        > click a button to select that customer and move off the page to the main
        > database details. I would like to implement being able to double-click
        > the listview item and it have the same effect as single clicking and then
        > pressing the button.
        >
        > My problem is that I can't get the double-click event to fire, the
        > single-click always gets in first??
        >
        > How do I tell the control that if the two clicks are in close succession
        > it is a double-click not two single clicks??
        >
        > I thought the system would go with the double-click if the clicks were
        > within the timeframe specified in the control panel for a double-click??
        >
        > --
        > Siv
        > Martley, Near Worcester, UK.
        >[/color]



        Comment

        Working...