c# - how do i call a click event from a string -


here problem.

    string btn = "btn7";     //this problem.     btnclone.click += this.controles[btn]_click ; 

so use string share event other button , string must.

i hope can me.

a more standard way find control id

button b = (button)findcontrol(btn); 

you search if don't know id

   button oldbutt = this.controls.oftype<button>().(b => b.name == btn).first(); 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -