How to implement Ctrl+MouseDown in Listbox

  1. last year

    changwon l

    31 Aug 2016 Pre-Release Testers

    Can we simulate Ctrl+MouseDown key pair of Windows to select one row and the other row selectively in ListBox?
    Shift+MouseDown key works as expected like I do in Windows, but Ctrl+MouseDown doesn't show any result, so please advise me to implement that feature.

  2. Emile S

    31 Aug 2016 Europe (France, Strasbourg)
    Edited last year

    First of all, read listbox .

    Second, get an eye on the KeyDown event.

    Third, something like:

    If Keyboard.ControlKey (info Here ).

    Come back here if the explanation above is not enought.

    After a re-reading of the question:
    You may have to store somewhere the Row clicks and use .Selected to select all rows like you want.

    That said, I do not understand why you want to do that (but I may need a nap).

  3. Jean-Yves P

    31 Aug 2016 Pre-Release Testers, Xojo Pro Europe (France, Besancon)

    look at the constructcontextualmenu event of the listbox. there are example in the dev manual.

  4. Michel B

    31 Aug 2016 Pre-Release Testers, Xojo Pro

    Jean-Yves, Changwon is on PC. There, Ctrl-MouseDown is not the same as right click.

    Changwon : Use KeyBoard.ControlKey to check is Control is down.

  5. @changwon l Can we simulate Ctrl+MouseDown key pair of Windows to select one row and the other row selectively in ListBox?
    Shift+MouseDown key works as expected like I do in Windows, but Ctrl+MouseDown doesn't show any result, so please advise me to implement that feature.

    It does this by default if you set MultiSelect to true

  6. changwon l

    1 Sep 2016 Pre-Release Testers

    Should I use a Timer(Action Event) to check CTRL key is down with KeyBoard.ControlKey?
    link text

    If that is the case, how can I enable the Timer? I know how to enable/disable it but it doesn't make sense to me as it seems that I should enable it with a very short of interval?

  7. Michel B

    1 Sep 2016 Pre-Release Testers, Xojo Pro
    Edited last year

    @changwon l Should I use a Timer(Action Event) to check CTRL key is down with KeyBoard.ControlKey?

    No You simply check Keyboard.Control key in MouseDown.

  8. Jeff T

    1 Sep 2016 Midlands of England, Europe

    Norm is correct:

    It does this by default if you set MultiSelect to true

    You dont need to trap it using mousedown.
    Just set the multiselect property to TRUE in the IDE

  9. changwon l

    1 Sep 2016 Pre-Release Testers

    It is already set with MultiSelect(True).

    My plan is:
    There are 100 rows.
    I drag 20 rows from 1 to 20 and 20 rows are selected.
    Then, I should jump 51th rows and select it, so finally I select 21 rows.

    For this requirement, I thought I should implement CTRL+Mouse Click to select the one.

  10. Michel B

    1 Sep 2016 Pre-Release Testers, Xojo Pro

    @changwon l It is already set with MultiSelect(True).

    My plan is:
    There are 100 rows.
    I drag 20 rows from 1 to 20 and 20 rows are selected.
    Then, I should jump 51th rows and select it, so finally I select 21 rows.

    For this requirement, I thought I should implement CTRL+Mouse Click to select the one.

    That should be automatic under Windows.

  11. Tim H

    1 Sep 2016 Pre-Release Testers Portland, OR USA

    There is nothing to implement. If you have tried it and it doesn't work, then there may be some bug in your code that is interfering with the normal behavior.

  12. 5 months ago

    changwon l

    Jul 16 Pre-Release Testers

    Yes, I think Jeremie UI_Listbox interferes the native feature. I don't see any issue with a Xojo listbox.

    Thanks.

  13. Neil B

    Jul 16 Pre-Release Testers

    I wrote a listbox subclass to fix issues with multiselect in the standard Xojo listbox on windows.

    https://www.dropbox.com/s/gqx67mrf9orld1l/WinListBox.xojo_binary_project?raw=1

    http://forum.xojo.com/conversation/post/332957

  14. Greg O

    Jul 17 Xojo Inc Somewhere near Raleigh, NC

    @Neil B I wrote a listbox subclass to fix issues with multiselect in the standard Xojo listbox on windows.

    https://www.dropbox.com/s/gqx67mrf9orld1l/WinListBox.xojo_binary_project?raw=1

    http://forum.xojo.com/conversation/post/332957

    You don't need that anymore. The issue was fixed in 2017r1.

  15. Neil B

    Jul 17 Pre-Release Testers

    @Greg O'Lone The issue was fixed in 2017r1.

    Issues you mean?

    My subclass provides a workaround for the following feedback cases. As of today none of these have been implemented.

    43704 - Status: Verified
    43705 - Status: Verified
    46694 - Status: Needs Review
    46521 - Status: Verified
    46520 - Status: Verified

or Sign Up to reply!