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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:43:32+00:00 2026-05-11T01:43:32+00:00

I have a Window with my user control and I would like to make

  • 0

I have a Window with my user control and I would like to make usercontrol width equals window width. How to do that?

The user control is a horizontal menu and contains a grid with three columns:

<ColumnDefinition Name='LeftSideMenu' Width='433'/> <ColumnDefinition Name='Middle' Width='*'/> <ColumnDefinition Name='RightSideMenu' Width='90'/> 

That is the reason I want the window width, to stretch the user control to 100% width, with the second column relative.

EDIT:

I am using a grid, there is the code for Window:

<Window x:Class='TCI.Indexer.UI.Operacao'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'     xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'     xmlns:tci='clr-namespace:TCI.Indexer.UI.Controles'     Title=' ' MinHeight='550' MinWidth='675' Loaded='Load' ResizeMode='NoResize' WindowStyle='None' WindowStartupLocation='CenterScreen' WindowState='Maximized' Focusable='True'     x:Name='windowOperacao'>     <Canvas x:Name='canv'>         <Grid>             <tci:Status x:Name='ucStatus'/> <!-- the control which I want to stretch in width -->         </Grid>     </Canvas> </Window> 
  • 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. 2026-05-11T01:43:32+00:00Added an answer on May 11, 2026 at 1:43 am

    You need to make sure your usercontrol hasn’t set it’s width in the usercontrol’s xaml file. Just delete the Width=’…’ from it and you’re good to go!

    EDIT: This is the code I tested it with:

    SOUserAnswerTest.xaml:

    <UserControl x:Class='WpfApplication1.SOAnswerTest'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'     xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'     Height='300'>     <Grid>         <Grid.ColumnDefinitions>             <ColumnDefinition Name='LeftSideMenu' Width='100'/>             <ColumnDefinition Name='Middle' Width='*'/>             <ColumnDefinition Name='RightSideMenu' Width='90'/>         </Grid.ColumnDefinitions>         <TextBlock Grid.Column='0'>a</TextBlock>         <TextBlock Grid.Column='1'>b</TextBlock>         <TextBlock Grid.Column='2'>c</TextBlock>     </Grid> </UserControl> 

    Window1.xaml:

    <Window x:Class='WpfApplication1.Window1'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'     xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'     xmlns:local='clr-namespace:WpfApplication1'     Title='Window1' Height='300' Width='415'>     <Grid>          <local:SOAnswerTest Grid.Column='0' Grid.Row='5' Grid.ColumnSpan='2'/>     </Grid> </Window> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to make my user control have invisible areas like the areas
I have a window with 2 column grid. Left column contains a browser control
I have a Window where I have put a Frame. I would like to
I have a Windows Form (C#) that dynamically generates copies of a User Control.
I have an app that has a ListBox of ListBoxes. I would like to
I have a greasemonkey user script with this single line of code... window.close(); but
I have a program that creates a Windows user account using the NetUserAdd() API
I have an application that is using Windows Authentication and a SqlRoleProvider for user
I have a window that is set with NSBorderlessWindowMask, and also kCGDesktopWindowLevel. When a
I have a window in WPF which shows some media contents. This content contains

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.