如何访问是一个TabControl选项卡内的控制? [英] How to access controls that are inside a TabControl tab?

查看:667
本文介绍了如何访问是一个TabControl选项卡内的控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我到目前为止所。

tabControl1.TabPages[0].???



我有我的TabControl的TabPage1内的一个图片。

I have a PictureBox inside of TabPage1 of my TabControl.

如何更改与代码中的图像位置,而不是属性面板?

推荐答案

虽然控制会出现一个容器内(如一个TabControl),它们都限定在表格上,因此没有必要通过容器来访问它们。

Although the controls appear inside a container (as a TabControl), they're all defined on the form, so there is no need to access them through the container.

而不是:


tablControl1.TabPages[0].MyContainedControl...

只需键入:


MyContainedControl...

这篇关于如何访问是一个TabControl选项卡内的控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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