简体   繁体   中英

Trigger a button click that is inside a user control from a windows form in c#

I'm developing an application in c# .net framework and I have a user control not developed by me that contains various buttons that when clicked show different kind of data and statistics (let's call it ucDataShow).

Such user control is in a different tab with respect to the main tab of my program (i'm talking about TabControl)

I'd like to create a button in my application that when clicked changes tab and shows the appropriate kind of data by simulating the click of the appropriate button of ucDataShow

Is there a way to do so?

you can change tabpage of tabcontrol like this: tabControl1.SelectedTab = tabControl1.TabPages[n];

but i think it is not possible to raise click event of button which is on ucDataShow control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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