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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:07:03+00:00 2026-05-19T02:07:03+00:00

This is difficult to explain without illustration, so – behold, an illustration, cobbled together

  • 0

This is difficult to explain without illustration, so – behold, an illustration, cobbled together from screenshots of a few hello-world examples and a lot of Paint work:

GUI mockup

I have started out using Windows Forms on .NET (via IronPython, but that shouldn’t be important), and haven’t been able to figure out very much. GUI libraries in general are very intimidating, simply because every class has so many possible attributes. Documentation is good at explaining what everything does, but not so good at helping you figure out what you need.

I will be assembling the GUI dynamically, but I’m not expecting that to be the hard part. The sticking points for me right now are:

  • How do I get text labels to size themselves automatically to the width of the contained text (so that the text doesn’t clip, and I also don’t reserve unnecessary space for them when resizing the window)?

  • How do I make the vertical scrollbar always appear? Setting the VScroll property (why is this protected when AutoScroll is public, BTW?) doesn’t seem to do anything.

  • How come the horizontal scrollbar is not added by AutoScroll when contents are laid out vertically (via Dock = DockStyle.Top)? I can use a minimum size for panels to prevent the label and corresponding control from overlapping when the window is shrunk horizontally, but then the scrollbar doesn’t appear and the control is inaccessible.

  • How can I put limits on window resizing (e.g. set a minimum width) without disabling it completely? (Just set minimum/maximum sizes for the Form?) Related to that, is there any way to set minimum/maximum widths or heights without setting a minimum/maximum size (i.e. can I constrain the size in only one dimension)?

  • Is there a built-in control suitable for hex editing or am I going to have to build something myself?

… And should I be using something else (perhaps something more capable?) I’ve heard WPF mentioned, but I understand that this involves XML and I really want to build a GUI from XML – I already have data in an object graph, and doing some kind of weird XML pseudo-serialization (in Python, no less!) in order to create a GUI seems incredibly roundabout.

  • 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-19T02:07:04+00:00Added an answer on May 19, 2026 at 2:07 am

    I ended up using WPF.

    Getting access to the functionality from IronPython is more involved than I would have expected:

    import clr
    clr.AddReferenceByName("PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
    clr.AddReferenceByName("PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
    clr.AddReferenceByName("WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
    import System.Windows
    

    (I’m not sure if I can/should change the version number. The PublicKeyToken presumably has to do with some kind of DLL signing for security purposes; I don’t know why WPF requires this but WinForms didn’t.)

    Since the namespaces for widgets get quite hairy and there are a lot of names that I want to import, I set up some dynamic import code:

    def Import(namespace, what):
        if isinstance(what, str):
            globals()[what] = getattr(namespace, what)
        else:
            for k, v in what.items():
                if k: namespace = getattr(namespace, k)
                for name in v:
                    Import(namespace, name)
    

    After figuring out the right combination of layout tools (which wasn’t as easy as this summary makes it sound), everything seems to “just work” and I’m quite pleased. The scroll behaviour is accomplished by setting up a ScrollViewer inside the main window and setting the HorizontalScrollBarVisibility to Auto. Inside the ScrollViewer I put a StackPanel which stacks the “field frames”, each of which is a Grid with two columns (I add two default ColumnDefinition s to the Grid.ColumnDefinitions). I set the “label” up in column 0, and the “value” widget (combo box, button, whatever) in column 1, with a HorizontalAlignment of Right.

    I haven’t set up the nested panels yet, but it seems like it shouldn’t be difficult. I’ve already played around with the system for hooking up events to buttons.

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

Sidebar

Related Questions

This might be a bit difficult to explain in writing, so please bear with
This is a difficult and open-ended question I know, but I thought I'd throw
I know this will be a difficult question, so I am not necessarily looking
I've found it very difficult to find any existing documentation on this. What I'm
It's surprising how difficult it is to find a simple, concise answer to this
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and
I'm having difficulty searching for this. How would I define an element in an
I usually do not have difficulty to read JavaScript code but for this one
I have been trying to tackle this problem , but I am having difficulty
This is a bit of a long shot, but if anyone can figure it

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.