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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:01:19+00:00 2026-06-09T10:01:19+00:00

I try to achieve a simple menubar in WPF. Here is the XAML: <Page

  • 0

I try to achieve a simple menubar in WPF.

Here is the XAML:

<Page
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
 <DockPanel>  
    <DockPanel Background="Black" VerticalAlignment="Top" LastChildFill="True" DockPanel.Dock="Top" Height="28">
        <ToggleButton Content="--" Visibility="Collapsed" />
        <StackPanel Orientation="Horizontal">
           <Button Content="Add" />
           <Button Content="Expand" /> 
        </StackPanel>
        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
           <TextBox Text="Search" MinWidth="80" Width="200" />
           <Button Content="X" Margin="0,1,50,0" />
        </StackPanel>
    </DockPanel>
 </DockPanel>
</Page>

It looks good, but when I resize the page to a smaller width, the last child (the Stackpanel with the search textbox) is hiding behind the left items.
Like this:
http://s9.postimage.org/m0tkrobwd/printscreen.png

It would be good if the textbox would resize itself if it has enough space to achieve its MinWidth…Is it possible?

  • 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-09T10:01:21+00:00Added an answer on June 9, 2026 at 10:01 am
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                          <ColumnDefinition Width="*"/>
                        <ColumnDefinition MaxWidth="200" MinWidth="80"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <ToggleButton Content="--" Visibility="Collapsed" />
                    <Button Content="Add"  Grid.Column="1"/>
                    <Button Content="Expand"  Grid.Column="2"/>
                    <TextBox Text="Search" Grid.Column="4"/>
                    <Button Content="X" Margin="0,1,50,0" Grid.Column="5" />
                </Grid>
    

    Instead of giving MaxWidth and MinWidth to TextBox give it to Grid Column.I hope this will help.

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

Sidebar

Related Questions

try: html = urlopen('http://glbse.com/api/asset/' + asset.name) except: print 'error while updating the price of
I'm trying to achieve the ramp effect as seen here: (source: splashdamage.com ) Blending
I'm trying to achieve the following with a bash script: try for SSH connection,
I try that a User can be member of several associations. To achieve this
After failing to achieve this with link_to remote, I decided to try jQuery way.
I am trying to achieve lookup method injection using a simple example. But, seems
I am trying to achieve a very simple thing in MATLAB. I have a
I have a simple problem try to stay DRY using Appengine. The 2 functions
I try to parse articles from wikipedia. I use the *page-articles.xml file, where they
I am trying to achieve a simple table row hover effect by changing the

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.