locked
How to prevent click event button on datagridview executed if i click outside button RRS feed

  • Question

  • Problem

    I have datagridview have button if i focus on it and click outisde button meaning click in any place on datagridview header

    it will execute the button code although i dont make click on button only I focus on it .

    i work on visual studio 2015 windows form 

    How to solve this problem please ?

    actually i need when focus on button and click on button execute button click but in my case 

    button click execute if i click outside button .

    • Moved by CoolDadTx Thursday, October 11, 2018 2:47 PM Winforms related
    Thursday, October 11, 2018 5:03 AM

All replies

  • Hi,

    >>actually i need when focus on button and click on button execute button click but in my case, button click execute if i click outside button.

    Please show some code here to describe how did you define the two button_click events, I guess this is because the two events have the same name, that means you bind these two events to one method.

    Please check it.

    Regards,

    Stanly


    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.

    Friday, October 12, 2018 1:47 AM