c# uwp 2019 how to do MouseDown event RRS feed

  • Question

  • In c# UWP VS 2019, I can't find a MouseDown event.  I am using the Pointer which is somewhat working.  I can click on the grid and display the coordinates in a textbox Those are used to calculate a grid coordinate painting an image.

    The problem is, I want to continue painting so long as the mouseKey is held down and within the grid. What is happening for me,  the PointerReleased is firing after every PointerPressed event occurs, even with the mouse key still being held down.  Without that working, I am going to have to click on every individual grid position instead of moving across the grid drawing an image.

    There events declarations and setup is done.  I defined a PointerMoved event to capture the current coordinates and write them to a Xaml textbox. Works.

    Then (some test stuff)

            private void canBoard_PointerPressed(object sender, PointerRoutedEventArgs e)
                tbRowGot.Text = "P:" + tbRow.Text;           
                tbColGot.Text   = "P:" + tbCol.Text;
            private void canBoard_PointerReleased(object sender, PointerRoutedEventArgs e)
                tbRowGot.Text = "R:" + tbRow.Text;
                tbColGot.Text   = "R:" + tbCol.Text;

    • Moved by CoolDadTx Wednesday, January 8, 2020 2:58 PM UWP related
    Tuesday, January 7, 2020 5:07 PM

All replies

  • Hi,
    I viewed your description, it is mainly related to UWP. So it is recommended to go to this forum and you can get more professional answer.
    Thank you for your understanding.
    Best Regards,
    Daniel Zhang

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 8, 2020 3:10 AM
  • Thanks Daniel

    I thought this is a the UWP forum.  Will do.

    Wednesday, January 8, 2020 1:29 PM