有些人可以帮助我解决以下问题:
我的WindowsForm应用程序中有一个TabControl,其中标签页是动态生成的。每个选项卡上显示的内容将从我的数据库中获取。我需要某种控件(可以显示所获取的数据),我可以在每个选项卡页面上添加(这对所有选项卡都是相同的),以便我可以在某个添加的控件上关联某种事件,例如点击。
任何人都可以告诉我如何以编程方式执行此操作写入所有添加的控件的点击事件?
I am new to C# .NET.
Can some one help me out with the below problem:
I have a TabControl in my WindowsForm application, where the tab pages are generated dynamically. The content to be displayed on each tab would be fetched from my database. I need some kind of control (which can display the fetched data) that I can add on each tab page (which would be same for all tabs) such that I can associate some kind of event, say click, on that added control.
Can anyone tell me how to do this programmatically & write the click event for all the controls added?
推荐答案请参考以下链接!您将在这方面获得更多细节。
Please refer the below link! You will get more detail in this regard.
在Visual Studio C#中创建动态数量的选项卡的选项卡控件
更多推荐
在C#.net中的tabcontrol中动态添加一个控件
发布评论