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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:03:32+00:00 2026-06-13T19:03:32+00:00

I am trying to create some rounded textboxes, and I have found some XAML

  • 0

I am trying to create some rounded textboxes, and I have found some XAML here on this site, and it works well at creating the textboxes I want. However, if I resize my window, either in the designer or at run time, the height and width of the textboxes change with it, and they get distorted and useless.

I’m still learning WPF, so I’m sure I am missing something simple. Thanks for any help.

<Window x:Name="mainWindow" x:Class="CMDB_Express.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="CMDB Express" Height="289" Width="600" SizeToContent="Height" MinHeight="289">
<Window.Resources>
    <ControlTemplate x:Key="TextBoxBaseControlTemplate" TargetType="{x:Type TextBoxBase}">
        <Border Background="{TemplateBinding Background}"
                x:Name="Bd" BorderBrush="Black"
                BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10">
        </Border>
    </ControlTemplate>
</Window.Resources>
<Grid>
    <TextBox Name="txtDOE" KeyboardNavigation.TabIndex="0" Template="{StaticResource TextBoxBaseControlTemplate}" Margin="139,59,339,159" FontFamily="Segoe UI" FontSize="18" VerticalContentAlignment="Center" MaxLength="7" />
    <Label x:Name="lblDOE" Content="DOE Number: " HorizontalAlignment="Left" Margin="10,72,0,0" VerticalAlignment="Top" FontFamily="Segoe UI" Height="33" FontSize="18"/>
    <TextBox Name="txtCustodian" KeyboardNavigation.TabIndex="1" Template="{StaticResource TextBoxBaseControlTemplate}" Margin="139,121,339,97" FontFamily="Segoe UI" FontSize="16" VerticalContentAlignment="Center" />
    <Label x:Name="lblCustodian" Content="Custodian: " HorizontalAlignment="Left" Margin="35,134,0,0" VerticalAlignment="Top" FontFamily="Segoe UI" Height="33" FontSize="18"/>
    <TextBox Name="txtBuilding" KeyboardNavigation.TabIndex="2" Template="{StaticResource TextBoxBaseControlTemplate}" Margin="396,59,75,159" FontFamily="Segoe UI" FontSize="16" VerticalContentAlignment="Center" />
    <Label x:Name="lblBuilding" Content="Building: " HorizontalAlignment="Left" Margin="307,72,0,0" VerticalAlignment="Top" FontFamily="Segoe UI" Height="33" FontSize="18"/>
    <TextBox Name="txtRoom" KeyboardNavigation.TabIndex="3" Template="{StaticResource TextBoxBaseControlTemplate}" Margin="396,121,75,97" FontFamily="Segoe UI" FontSize="16" VerticalContentAlignment="Center" />
    <Label x:Name="lblRoom" Content="Room: " HorizontalAlignment="Left" Margin="325,134,0,0" VerticalAlignment="Top" FontFamily="Segoe UI" Height="33" FontSize="18"/>
    <TextBox x:Name="txtDnsName" KeyboardNavigation.TabIndex="1" Template="{StaticResource TextBoxBaseControlTemplate}" Margin="139,183,339,35" FontFamily="Segoe UI" FontSize="16" VerticalContentAlignment="Center" />
    <Label x:Name="lblDnsName" Content="DNS Name: " HorizontalAlignment="Left" Margin="35,196,0,0" VerticalAlignment="Top" FontFamily="Segoe UI" Height="33" FontSize="18"/>
    <Expander x:Name="expAdvanced" Header="Advanced..." HorizontalAlignment="Left" Margin="262,234,0,0" VerticalAlignment="Top">
        <Grid Background="#FFE5E5E5">
            <Label x:Name="lblExpanded" Content="EXPANDED!"/>
        </Grid>
    </Expander>
</Grid>

  • 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-06-13T19:03:34+00:00Added an answer on June 13, 2026 at 7:03 pm

    Check horizontal and vertical alignment properties they are set to stretch by default

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

Sidebar

Related Questions

I am trying to create some div (that should be buttons) that have rounded
I have been trying to create some dynamic Xaml. I have the following c#
I am trying to create some simple polygons in openGL3.3. I have 2 types
I trying to create some dirs like this: @mkdir(photos/$cat/$sku, 0777, true) it creates the
I'm trying to create some custom code inside my Sub Layout. I have to
I'm trying to create some nice links over my website. I'm creating a search
Im trying to create some new extensions in joomla. I want to add additional
I'm trying to create some cascading drop downs. I have my States loading via
I'm trying to create some drop-downs for a toolbar and want them to look
So I'm trying to create some scripts that I want to run without manually

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.