Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot click or select Control XAML design

I develop on VS2010 WPF on Window 7. I have a project that does not throw any error or warning, compile fine, XAML design shows fine except I cannot click or select anyone controls in the XAML design view.

What is the reason, or how can I find out the problem or possible exception?

like image 932
KMC Avatar asked Nov 29 '25 04:11

KMC


2 Answers

Had the same problem, I was able to select controls in the VS2012 WPF project previously but something had changed.

Worked out it was a TabItem in a TabControl, I had set the visibility to collapsed

<TabItem Visibility="Collapsed">

to hide the tab header at the top. Setting the TabItem visibility back to visible

<TabItem Visibility="Visible">

allows controls contained in the TabItem to be selected in the XAML design view.

like image 179
Moon Waxing Avatar answered Dec 01 '25 18:12

Moon Waxing


I have reproduced this behavior by putting an empty grid as the last child element of my "main" Grid. In VS2010's designer, I cannot select any of the Buttons. Could this be your issue?

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Button Content="Button" Height="52" HorizontalAlignment="Left" Margin="93,74,0,0" Name="button1" VerticalAlignment="Top" Width="113" />
        <Button Content="Button" Height="38" HorizontalAlignment="Left" Margin="280,100,0,0" Name="button2" VerticalAlignment="Top" Width="96" />

        <Grid></Grid>             <!--   THIS IS THE PROBLEM!!!  -->

    </Grid>     
</Window>
like image 22
JFTxJ Avatar answered Dec 01 '25 18:12

JFTxJ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!