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

  • SEARCH
  • Home
  • 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 4547968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:09:49+00:00 2026-05-21T16:09:49+00:00

I might’ve dreamed it, but I remember somewhere I read that it was possible

  • 0

I might’ve dreamed it, but I remember somewhere I read that it was possible to use a scale transform to change the size of a border, and that there’s a property that will keep the border width to what it was before using the scale (what I might’ve dreamed is this property, not the scale transform =P).

So, normally, if I have a border with BorderWidth of 1, and I scale it to make it bigger, the BorderWidth will look like it is 10 or something. I want the control itself to be bigger, but the its border to keep the 1 pixel width.

Anyone know how to do this?

Thanks!

  • 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-21T16:09:49+00:00Added an answer on May 21, 2026 at 4:09 pm

    Sure, just layout-transform scale a zero-width border to any size you like and wrap it in one-pixel width border.

    <Grid>
        <Border BorderThickness="1" BorderBrush="Black" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Border Height="100" Width="100">
                <Border.LayoutTransform>
                    <ScaleTransform ScaleX="2" ScaleY="2"/>
                </Border.LayoutTransform>
                <TextBlock Text="Some text"/>
            </Border>
        </Border>
    </Grid>
    

    Edit:

    OK, take two for when the scaling is coming in externally.

    Here is a little markup demo with a canvas being transformed and containing a border:

    <Grid>
        <Grid.Resources>
            <local:DescalingConverter x:Key="descalingConverter"/>
        </Grid.Resources>
        <Canvas Name="canvas">
            <Canvas.LayoutTransform>
                <ScaleTransform ScaleX="2" ScaleY="2"/>
            </Canvas.LayoutTransform>
            <Border BorderThickness="{Binding ElementName=canvas, Converter={StaticResource descalingConverter}}"
                    BorderBrush="Black" Width="100" Height="100">
                <TextBlock Text="Some text"/>
            </Border>
        </Canvas>
    </Grid>
    

    and here is the de-scaling converter:

    public class DescalingConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var element = value as FrameworkElement;
            var transform = element.LayoutTransform as ScaleTransform;
            if (transform == null) return 1.0;
            return 1.0 / transform.ScaleX;
        }
    
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    

    Note that the converter is not robust and is only from demonstration purposes.

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

Sidebar

Related Questions

Might be a bit of noob question but it's something that's been getting me
Might be a simple question, but I can't find an answer that fits this
might be a basic one but i wrote a function that selects all from
That might sound silly but can't do it myself :( Need your help guys.
Might be a silly question, but is there any reason to use Math.Sign? Is
Might be subjective and/or discussion.. but here goes. I've been asked to estimate a
might be a stupid question but I seem to be confused. Im pretty new
Might be a stupid question but in our iOS app we're storing an integer
This might not be a good question, but I'm gonna ask anyway... so..I usually
this might look silly to you but I am stuck here . I have

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.