Click here to Skip to main content
15,846,211 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
I am using Tab control in my application. At design time I am not moving on different tab item but at run time its work. It always comes on first tab. Is there any property of tabcontrol that I have to set?
<Window x:Class="DLL_TEACHER.Window1"
    Title="Teacher"  Height="700" Width="1300">
    <Canvas Width="1249">
        <Image Canvas.Left="0" Canvas.Top="0" Height="71" Name="image1" Stretch="Fill" Width="120" Source="D:\Software Development\vishal_wpf\vishal_WPF\DLL_2008_WPF\DLL_TEACHER\DLL_TEACHER\Images\logo.jpg" />
        <TabControl Canvas.Left="0" Canvas.Top="77" Height="572"  Width="1252"  Name="tabControl1">
            <TabItem Header="Student Status" Name="tabItem1" >
                this is one
            <TabItem Header="Lesson Assignment" Name="tabItem2" >
                this is two
            <TabItem Header="Lesson Preperation" Name="tabItem3" >
            <TabItem Header="Saved Lesson" Name="tabItem4" >
            <TabItem Header="chat" Name="tabItem5" >
Updated 19-Apr-11 0:04am

Share this answer
Sergey Alexandrovich Kryukov 19-Apr-11 11:55am    
Nothing says SP1 not installed. IsSelectected is not used in XAML.
Prerak Patel 19-Apr-11 23:41pm    
Actually OP wants to switch tabs just like forms tab at design time by mouse click. That was a known bug and taken care in SP1. You set it selected in XAML is a work around for that.
Sergey Alexandrovich Kryukov 20-Apr-11 0:05am    
Well, where the selection is supposed to be without IsSelected before fix and after fix?
Prerak Patel 20-Apr-11 0:16am    
It is all about "tab clicked should be brought to front, even at design time"
Sergey Alexandrovich Kryukov 20-Apr-11 0:33am    
I understand: a design mode only bug, failure to select. I never saw it. I already voted 5.
My last question is: does it mean other tabs were inaccessible even for adding controls "by mouse" before the fix?
You'are asking about the property. You can use System.Windows.Forms.TabControl.SelectedIndex.

Share this answer
Espen Harlinn 19-Apr-11 16:32pm    
Sergey Alexandrovich Kryukov 19-Apr-11 16:47pm    
Thank you, Espen.

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