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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:59:54+00:00 2026-05-26T16:59:54+00:00

I have a scenerio where I want to dynamically render a custom form object.

  • 0

I have a scenerio where I want to dynamically render a custom form object. This form is similar to a WinForms form. It will display one of more button bars, buttons can only live within a button bar in our implementation, and numerous edit control that the user will use for data entry.

In rendering the form we have in a configuration file a row height and column width, both as a pertcentage of the application area. All forms share a common row height and column width. The actual device unit value of these are calculated on applicaiton initialization.

My issue is with sizing the form. For example, I have a form that is supposed to be 15 rows by 80 columns, let’s say this translates to 500 units high and 800 units wide. This would be the form area, not including button bars. Right now I am calculating the window height and width in a FormPreviewManager. However, it is cumbersome as I have to give the total units, including the size of the button bar(s) and the windows borders, which may change as they have the option of including a title bar or not in the floating form window.

Within the rendering of the form I use a DockPanel to render the button bar(s) and claim the remaining space as my grid of rows and columns. I tried creatign the button bar(s), setting the remaining space to my FormGrid object, then specifically setting the Width and Height for the FormGrid but it doesn’t change the size of the containing window.

How can I make it so that the floating window sizes automatically? I want to be able to draw the button bar(s) then say remaining space is 500 units high and 800 units wide, the window then adjust to whatever size it needs to hold this data, no more and no less.

Any help on this, or a possible other approach, would be great.

Update

Basically if this was my entire XAML definition for my window I would like to be able to set the width and height of UnusedContent and have the window resize accordingly.

<Grid>
    <DockPanel>
        <StackPanel DockPanel.Dock="Top" Height="50" />
        <StackPanel DockPanel.Dock="Left" Width="50" />
        <ContentControl x:Name="UnusedContent" />
    </DockPanel>
</Grid>

If I set UnusedContent to 200 by 200 it would create a window with interior dimensions of 250 by 250, the content area plus the two stack panels.

  • 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-26T16:59:54+00:00Added an answer on May 26, 2026 at 4:59 pm

    You can try placing a control to fill up the remaining DockPanel space, and then binding to that control’s ActualHeight and ActualWidth properties

    <DockPanel>
        <StackPanel DockPanel.Dock="Top" Height="50" />
        <StackPanel DockPanel.Dock="Left" Width="100" />
        <ContentControl x:Name="Spacer" />
    </DockPanel>
    
    <Grid Height="{Binding ElementName=Spacer, Path=ActualHeight}"
          Width="{Binding ElementName=Spacer, Path=ActualWidth}" />
    

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

Sidebar

Related Questions

Hope you all will be fine. The scenerio is I have a form on
We have a scenario where we want to display a list of items and
I have a scenario where I want to dynamically add words of text to
I have a scenario where i want to dynamically generate a python script -
I have a JPanel and i am creating JButtons dynamically on runtime. I want
Hi i have a scenerio i have a database dump which i want to
I have an requirement where i have to display some content on iframe dynamically.
Hope you all will be fine. The scenerio is that i have a page
The scenerio is like this: I have to use multi-field query, which indexed several
I have the following scenario I want to add methods dynamically to a controller.

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.