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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:30:12+00:00 2026-05-22T23:30:12+00:00

I am building a control depicting a diagram. The control’s content (which is rather

  • 0

I am building a control depicting a diagram. The control’s content (which is rather complex) will try to scale to fit allotted space to the extent possible. However, not all scales are valid. The content cannot shrink indefinitely. E.g. a box on a diagram should be at least 20 pixels wide. Thus, when the window is too small to fit the content even at the minimum size, scaling should stop and scroll bars must appear.

I cannot find an elegant solution for this in WPF. Any design ideas are greatly appreciated.

  • 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-22T23:30:13+00:00Added an answer on May 22, 2026 at 11:30 pm

    Set the Horizontal & VerticalAlignment of the content to Stretch but also set the MinWidth and MinHeight to appropriate values, place your content in a ScrollViewer whose Horizontal & VerticalScrollBarVisibility is set to Auto.

    That should work, probably…

    Example:

    <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <Button
                MinHeight="400"
                MinWidth="400"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                Content="Buttons!"/>
        </ScrollViewer>
    </Window>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building an asp.net cutom control inside which I have two dropdownlists: companyIdSelection and
I'm building a menu control that consists of a header area and a content
I'm building a web control that will let our junior IT staff manage firmware
I'm building a custom edit control which consists of adding both an icon at
I have a jquery tab control in which I am building a custom control
When building a custom control, how would you access the content between the opening
I'm building a GridView control which encapsulates a child gridview. The child gridview holds
I'm building a site which requires being able to have advanced control over a
I am building an application which opens a website in WebBrowser control and then
I'm building a composite control that uses the telerik ajax controls as it's inputs,

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.