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 6002115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:55:52+00:00 2026-05-23T00:55:52+00:00

I have the following border in XAML: <Border Grid.Column=0 Grid.ColumnSpan=3 Grid.RowSpan=3 CornerRadius=1,1,1,1 Background=Red BorderBrush=#333333

  • 0

I have the following border in XAML:

<Border
    Grid.Column="0"
    Grid.ColumnSpan="3"
    Grid.RowSpan="3"
    CornerRadius="1,1,1,1"
    Background="Red"
    BorderBrush="#333333"
    BorderThickness="1,1,1,1"
    x:Name="border"
    RenderTransformOrigin="0.5,0.5">
    <Border.RenderTransform>
        <TransformGroup>
            <ScaleTransform />
            <SkewTransform />
            <RotateTransform />
            <TranslateTransform />
        </TransformGroup>
    </Border.RenderTransform>
    <ContentPresenter
        x:Name="contentPresenter"
        Margin="10,0,10,0"
        ContentTemplate="{TemplateBinding ContentTemplate}"
        VerticalAlignment="Center"
        HorizontalAlignment="Center" />
</Border>

and I’m trying to create a similar border in code behind (C#). I can’t get beyond Border b = new Border(), I’m not sure how I’m supposed to put the border inside the specific grid column or how to span it.

Any ideas?

  • 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-23T00:55:53+00:00Added an answer on May 23, 2026 at 12:55 am

    Something like this:

    var border = new Border();
    
    Grid.SetColumn(border, 0);
    Grid.SetColumnSpan(border, 3);
    Grid.SetRowSpan(border, 3);
    
    border.CornerRadius = new CornerRadius(1);
    border.Background = new SolidColorBrush(Colors.Red);
    border.BorderBrush = new SolidColorBrush(Color.FromArgb(0xff, 0x33, 0x33, 0x33));
    border.BorderThickness = new Thickness(1);
    border.RenderTransformOrigin = new Point(0.5, 0.5);
    
    var transformGroup = new TransformGroup();
    transformGroup.Children.Add(new ScaleTransform());
    transformGroup.Children.Add(new SkewTransform());
    transformGroup.Children.Add(new RotateTransform());
    transformGroup.Children.Add(new TranslateTransform());
    border.RenderTransform = transformGroup;
    

    Let me know if you want me to set the rest of the properties.

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

Sidebar

Related Questions

I have the following xaml: <Border BorderBrush=Black BorderThickness=1.5 CornerRadius=5> <Grid ShowGridLines=True> <Grid.ColumnDefinitions> <ColumnDefinition Width=Auto/>
I have the following xaml in my window: <Border Height=100 BorderBrush=Black BorderThickness=2 CornerRadius=10 Background=PaleVioletRed
I have the following XAML: <Border x:Name=ClippingBorder VerticalAlignment=Stretch BorderThickness=0> <Border.Clip> <RectangleGeometry RadiusX=4.4 RadiusY=4.4 Rect={Binding
I have the following in my XAML: <Grid x:Name=LayoutRoot Background=White> <Grid.RowDefinitions> <RowDefinition Height=20/> <RowDefinition
I have the following XAML: <ListBox HorizontalAlignment=Left Margin=0,6,0,10 Name=listBox1 Width=468 ItemsSource={Binding} Grid.ColumnSpan=1> <ItemsControl.ItemTemplate> <DataTemplate>
I have the following XAML: <StackPanel> <StackPanel Orientation=Horizontal> <Border Name=B1 Width=Auto> <DataGrid /> </Border>
I have the following xaml which resides in a wpf user control - <Grid>
I have following code <h1>Test</h1> <p>Another test</p> h1 { border:2px solid red; margin-bottom:30px; }
I have the following XAML/Control Template for a ListViewItem: <Window.Resources> <ControlTemplate x:Key=ItemTemplate TargetType=ListViewItem> <Border
I have the following xaml: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width=150/> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <StackPanel Orientation=Horizontal

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.