在C#.net中的tabcontrol中动态添加一个控件 [英] adding a control to tabs generated dynamically in tabcontrol in C# .net

查看:496
本文介绍了在C#.net中的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中动态添加一个控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆