在C#.net中的tabcontrol中动态添加一个控件

编程入门 行业动态 更新时间:2024-10-25 22:35:51
本文介绍了在C#中的tabcontrol中动态添加一个控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有些人可以帮助我解决以下问题:

我的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中动态添加一个控件

本文发布于:2023-11-06 22:31:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1564851.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   动态   net   tabcontrol

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!