Visual Studio C# WPF tabControl, can't change tab in visual editor?

I have made a very simple project in visual studio C# using WPF. Now I have created 3 tabs and added buttons to them all via the XML code manually. Now when I compile the app I can change tabs and all the buttons work as expected.

Now for the problem. In the visual editor I cannot change tabs, I can only view the first tab that was created and use the visual editor here. If I try clicking on the 2nd tab it just will not change.

I have sent my project to a friend who has Visual Studio 2008 and he can change tabs in the identical project however no matter what I do I cannot. I have tried everything short of reinstalling Visual studio.

Does anyone have any idea what could be causing this problem? There doesn't appear to be any issues with my project it all compiles with no warnings.

I have tried making a new project but they all suffer the same problem providing I use WPF, if I use a windows form project I do not have this issue with tabControl.

Thank you.
LVL 1
foliage_Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

foliage_Author Commented:
Just reinstalled Visual studio and still the same.
0
foliage_Author Commented:
I've found a really dodgy way to select tabs for the time being, if I delete all the tabs but the one I want, then press control + Z for as many tabs as I deleted, it will change and not remove anything.

Annoying as <expletive deleted>, but it will have to do for now.
0
foliage_Author Commented:
Appears my problem is more I can't seem to use the visual editor with tabcontrol. The buttons I had were not actually on any of the tabs.

Anyone know any guides on how to work with tabs using the VISUAL editor, I can't be bothered writing it all manually as it is just a simple program, just want to drag and drop buttons and texboxes where I want them.
0
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Bob LearnedCommented:
I would like to help you, but I only have .NET 2010 installed, and I think that it is important to know what version you are using, because it might be fixed in 2010.
0
foliage_Author Commented:
um visual studio 2008 and whatever .net it comes with, 3.5 I think.
0
Bob LearnedCommented:
With the 2010, and the attached XAML, I am able to click on the tabs, and the property grid changes:


<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="clr-namespace:System;assembly=mscorlib" 
    xmlns:c="clr-namespace:System.Collections;assembly=mscorlib" 
    xmlns:winf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    xmlns:my1="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
    Title="Window1" Height="362" Width="601">
    <Grid>
        <TabControl HorizontalAlignment="Stretch">
            <TabItem Header="Tab 1">
            </TabItem>
            <TabItem Header="Tab 2">
            </TabItem>
        </TabControl>
    </Grid>
</Window>

Open in new window

0
foliage_Author Commented:
I can host the project if that would help people with helping me?
0
Bob LearnedCommented:
I don't believe that the problem is with the code, so that wouldn't help me.  Are you saying that when you click on the tabs in the designer, that nothing is changing on the Property window?
0
foliage_Author Commented:
No the propertie window changes, but the visual tab does not change.

Think of it this way, you have the compiled project with 3 tabs running, you can click each tab and it will show a different window.

Using windows form projects the same functionality occurs in designer, as in you click a tab, drag and drop the textboxs, buttons etc onto it, click another tab, drag and drop what you want. Compile and it all works as expected.

However with WPF when you click the tabs, the window does not actually change, you are still stuck on the one single tab, no matter how many tabs you add to the project, you cannot actually VIEW the other tabs in the designer, you can only view them via the compiled project.
0
Bob LearnedCommented:
1) WPF is a new technology, and with Microsoft, applications usually take a bit of time to mature.

2) I was able to click on the tab in the designer, and the Property window changed, and the displayed controls changed, depending on the selected tab.

3) This might be fixed in 2010, but since I don't have 2008 installed anymore, I can't be sure.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
foliage_Author Commented:
I'll grab a copy of 2010 and report back.
0
foliage_Author Commented:
Upgrading to 2010 seems to have rectified the problem.

Thanks.
0
patrikmichnacCommented:
I have same problem and I am very sad about that. Is here anyopne who can help us? I have big project in Visual Studio 2008. It is not easy to install new studio 2010. In my editor there is one form with tabcontrol. If I click on tab page it doesn't change. I have still first page selected. IO can put any other contreol in other than first tab page.
0
foliage_Author Commented:
I tried basically everything and have since found the problem exists on a friends 2008 installation also, not sure if it is platform wide or just specific to some configurations.

The only workaround I found was to delete all the tabs but the one you want to view, control z all the tabs back and it will have switched to the one you want. Annoying and tedious, but it did work.

Perhaps submit a request to Microsoft for help? You never know, they might actually answer you in a timely fashion.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.