Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3391562
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:49:01+00:00 2026-05-18T03:49:01+00:00

I am creating a WPF application in VS2010. I am using multiple grid controls

  • 0

I am creating a WPF application in VS2010. I am using multiple grid controls layered on top of one another to perform similar functions to a tab control. The grid controls have an opaque (white) background.

The trouble occurs because no matter which grid I have ‘in front’ in the design window, I can still see all the outlines of all the other controls on the other grids which are ‘behind’ the top panel. It is extremely visually confusing.

This only happens at design time. At run time, things display just fine.

How do I turn off the outlines of all those other controls?

The screen shot below shows my top grid which only contains 4 text boxes and 4 radio buttons, but shows the outlines from all the other controls on the other grids.

alt text

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T03:49:02+00:00Added an answer on May 18, 2026 at 3:49 am

    Set a RenderTransform on any grid whose controls you don’t want to see outlines for, for example:

    <Grid RenderTransform="1 0 0 1 10000 10000">
    

    You could use an attached property to make this convenient, allowing you set the grid to automatically transform whenever it is hidden simply by writing:

    <Grid my:OutOfThisWorld.WhenHidden="True">
    

    Here is the code:

    public class OutOfThisWorld : DependencyObject
    {
      // GoAway
      public static bool GetGoAway(DependencyObject obj) { return (bool)obj.GetValue(GoAwayProperty); }
      public static void SetGoAway(DependencyObject obj, bool value) { obj.SetValue(GoAwayProperty, value); }
      public static readonly DependencyProperty GoAwayProperty = DependencyProperty.RegisterAttached("GoAway", typeof(bool), typeof(OutOfThisWorld), new UIPropertyMetadata
      {
        PropertyChangedCallback = (obj, e) =>
        {
          obj.SetValue(UIElement.RenderTransformProperty,
            (bool)e.NewValue ? new TranslateTransform(100000,10000) : null);
        }
      });
    
      // WhenHidden
      public static bool GetWhenHidden(DependencyObject obj) { return (bool)obj.GetValue(WhenHiddenProperty); }
      public static void SetWhenHidden(DependencyObject obj, bool value) { obj.SetValue(WhenHiddenProperty, value); }
      public static readonly DependencyProperty WhenHiddenProperty = DependencyProperty.RegisterAttached("WhenHidden", typeof(bool), typeof(OutOfThisWorld), new PropertyMetadata
      {
        PropertyChangedCallback = (obj, e) =>
        {
          if((bool)e.NewValue)
            BindingOperations.SetBinding(obj, GoAwayProperty,
              new Binding("Visibility")
              {
                RelativeSource=RelativeSource.Self,
                Converter = new IsHiddenConverter()
              });
        }
      });
    
      class IsHiddenConverter : IValueConverter
      {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
          return (Visibility)value == Visibility.Hidden;
        }
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); }
      }
    }
    

    How it works: Setting OutOfThisWorld.WhenHidden creates a binding to the OutOfThisWorld.GoAway property such that whenever the target’s Visibility is “Hidden” the GoAway property is true. When GoAway actually goes true, the RenderTransform is added.

    Having said all that, have you considered using Visibility=Collapsed instead of Visibility=Hidden? It might be simpler.

    I also have to strongly endorse Will’s observation that this is a terrible design. How “stuck with it” are you really? If it is a political thing, I’m sorry for you. But from a technical standpoint refactoring this into a real tab control with a template should be very easy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a WPF Application using VS 2005. I download the add on
I have a WPF application running with VS2010 .Net3.5 using Nhibernate with FluentNHibernate +
I am creating a WPF application that will integrate with an existing system using
I'm creating a WPF application using the MVVM design pattern that consists of a
I'm creating a WPF application using the MVVM design pattern, and I'm trying to
Situation I'm creating a C#/WPF 4 application using a SQL Compact Edition database as
I'm creating a WPF application where several ListView selections are made in a row
I am creating menus in WPF programatically using vb.net. Can someone show me how
In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch
My WPF application is structured using the MVVM pattern. The ViewModels will communicate asynchronously

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.