Click here to Skip to main content
15,851,387 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
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
Posted
Comments
abbaspirmoradi 15-Sep-13 6:18am    
Edit your question salwa, please ..
sajjad hasanzadeh 16-Sep-13 2:35am    
get more information, please

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;

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


I hope this will help you.


Thank's
Mohan G
 
Share this answer
 
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
C#
TabItem currentTab = MyTabControl.SelectedItam as TabItem;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900