简体   繁体   English

从发件人获取GroupBox名称

[英]Get the GroupBox name from the sender

Is it possible to get the GroupBox name(Text Name) from the button's Click argument - Sender , where the button resides inside the GroupBox . 是否有可能获得GroupBox从按钮的名称(文字名称) Click参数- Sender ,其中按钮所在的内部GroupBox

I don't want to use use GroupBox instance inside the button_click() event. 我不想在button_click()事件中使用use GroupBox实例。

使用Parent属性。

((Button) sender).Parent.Text

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM