Invoking the click method of a button programmatically

前端 未结 2 1886
悲&欢浪女
悲&欢浪女 2021-01-21 22:32

Simple problem (I think): I want to be able to invoke a click method on a predefined object, specifically, the bindingNavigatorDeleteItem button on the standard c#

相关标签:
2条回答
  • 2021-01-21 23:22

    Instead of intercepting the toolstrip button (and leaving other techniques open to the user, such as deleting a row within a DataGrid), use one of the events on your Data Source to cancel the delete if invalid.

    0 讨论(0)
  • 2021-01-21 23:27

    To simply invoke the click - you should be able to use PerformClick().

    I was a little lost by the other things you mentioned - can you clarify?

    0 讨论(0)
提交回复
热议问题