Results 1 to 2 of 2

Thread: A Shrinking Form

  1. #1

    Thread Starter
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    A Shrinking Form

    I haven't looked at this in sufficient detail at the time I'm writing this, so this question is nothing more than a fishing expedition to try to get some ideas.

    I have a busy form in an application. The bottom of the form has three tab pages. The whole tab control is wide, but not very high, as it has been shrunk down to fit at the bottom of a form that is otherwise pretty busy. The rest of the form is divided up into a variety of different regions, each of which holds a group of controls. The sheer mass of controls on the form is what makes it busy.

    Due to all the stuff on the form, the form barely fits on the typical laptop screen. That's important, because the application will typically be used on a typical laptop. The application is sometimes run on larger screens, but the design really does have to target laptops with their restricted screen area.

    The first issue I'm having is that there's too much going on with that screen. If anything causes the form to shrink, it becomes difficult or impossible to use. For that reason, I'm going to redesign the form to break it up into multiple pieces, without it being so very busy. This will allow it to be displayed on smaller screens while still being usable. However, that's really only tangential to the issue.

    One of the buttons on the screen brings up a second form that shows waypoints placed on a map, which is typically aerial imagery. This is using Bing Maps, since Microsoft has controls (WPF controls, though this is not a WPF application, but they still work) to use aerial imagery in a desktop application.

    When that form is displayed, the other form, and even the entire program, gets shrunk down. Everything is still there, and it is all usable. It's not that the form is shrinking while the controls stay the same size. If that were happening, some of the controls would no longer be visible. What is happening is that the entire form is shrinking, along with everything on it. If the form is full screen, it goes to windowed. If it is already windowed, it remains windowed, but in either case, everything is scaled down.

    It appears that the scaling down is different on different monitors, so this seems likely to be a DPI issue, but it is only triggered by opening this other form that shows the WPF control. WPF does a better job of DPI scaling than Windows Forms does, and the WPF component, and the form it is on, look fine, but the other forms behind it get shrunken, and remain shrunken after the WPF form is closed.

    Is there any good way to prevent this? Is there something I can readily measure to see why background forms in the application scale down when I display that form?
    My usual boring signature: Nothing

  2. #2
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    846

    Re: A Shrinking Form

    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width