选项卡控件中的哪个wpf标签项 [英] which wpf tab item in tab control

查看:81
本文介绍了选项卡控件中的哪个wpf标签项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

if i have tab control have alot of tab items ,each tab item have user control in it ,I want to check which tab is active based on control name in it there is action will done,
how can I check which tab is selected ,c#
inside textbox_textChanged

推荐答案

您好Salwa,



如果更改文本框文本意味着您想知道哪个标签页包含该文本框(活动标签页),据我所知。试试这个;



Hi Salwa,

If the Textbox text is changed means you want to know which tab page is contain that Textbox(Active Tab Page), For my understanding. try this;

string pare = textBox1.Parent.Controls.Owner.ToString(); //Here give your control instead of textBox1





我希望这会对你有所帮助。





谢谢

Mohan G



I hope this will help you.


Thank's
Mohan G


如果我理解你的问题,你问的是如何确定哪个标签是活跃的。如果这是你想要实现的,你只需要查看 TabControl SelectedItem ,就像这样
If I understand your question properly, you are asking how do you work out which tab is active. If this is what you are trying to achieve, you simply need to look at the SelectedItem of the TabControl, like this
TabItem currentTab = MyTabControl.SelectedItam as TabItem;


这篇关于选项卡控件中的哪个wpf标签项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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