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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:10:26+00:00 2026-06-02T03:10:26+00:00

I have a stretch problem with my scroll viewer, I have a textbox and

  • 0

I have a stretch problem with my scroll viewer, I have a textbox and button inside a dock panel along with my scrollviewer, I wanted the scroll viewer underneath those items but stretched to the width of the dock panel and height stretched from the bottom of the dock panel up to the button and textbox.

So I tryed this:

<UserControl x:Class="WpfApplication4.AppPages.FindStudent"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Loaded="UserControl_Loaded">
    <DockPanel Height="299" Width="289">
        <TextBox Height="23" Name="textBox1" Width="188" VerticalAlignment="Top"/>
        <Button Content="Button" Height="23" Name="button1" Width="100" Click="button1_Click" VerticalAlignment="Top" />
        <ScrollViewer VerticalScrollBarVisibility="Hidden" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="88">

However the scroll viewer is somehow stuck to the right hand side like so:

enter image description here

  • 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-02T03:10:28+00:00Added an answer on June 2, 2026 at 3:10 am

    You’ll need to tell the items how to dock using the attached property DockPanel.Dock.

    Something like this:

    <DockPanel>
        <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
            <TextBox />
            <Button />
        <StackPanel>
        <ScrollViewer DockPanel.Dock="Top" />
    </DockPanel>
    

    Note that by default the last child of the DockPanel will fill remaining available space.

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

Sidebar

Related Questions

I have a problem with displaying images in WPF. Here's my code: <Button HorizontalAlignment=Left
Here is the code I have : <ScrollViewer Grid.Row=2 CanContentScroll=True> <DockPanel> <TreeView x:Name=tView DockPanel.Dock=Top
I have the following construct, which shows a DataBound ListBox and a Button inside
So far I have managed to get the background image to stretch: XHTML: <div
I have print $str; abcd*%1234$sdfsd..#d The string would always have only one continuous stretch
I have two <textField> one by one. Is possible to automatically stretch or shrink
I have a Windows Mobile application. Within that application, i've got a ScrollViewer which
I have a problem with control visibility in listbox itemtemplate. Following is my code
I have the following code in my DataGridTemplateColumn: <Controls:DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <StackPanel Orientation=Horizontal> <TextBox Text={Binding
I have for like 2 hours tried to find out the problem with 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.