选项卡控件中的哪个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 theSelectedItem
of theTabControl
, like this
TabItem currentTab = MyTabControl.SelectedItam as TabItem;