Results 1 to 7 of 7

Thread: [RESOLVED] Dynamically size controls for different screen resolutions

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Location
    Roodepoort, South Africa
    Posts
    472

    Resolved [RESOLVED] Dynamically size controls for different screen resolutions

    I'm trying to implement a dynamic screen resize to fit my forms to different screen resolutions. Almost everything is working fine.

    Form and controls sizes and positions are read from datatable. Form gets resized, controls gets resized and moved to their new positions but...

    On some of the forms there are controls grouped in frames. The frames and controls are resized 100% but, except for label controls that are correctly displayed in the frames, all other controls (buttons, textboxes, radio buttons etc) are not visible.

    It's as if the frame is in front of the controls. The controls are there, but not visible, and when I click a position where a control are situated the control are displayed but not as it should look e.g. a textbox will be displayed without its border etc.

    When I minimize the form to the taskbar and then restore it all my controls are there and displayed correctly.

    Any ideas?

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: Dynamically size controls for different screen resolutions

    Do you have a picturebox inside the frame in which you have to child controls?
    Maybe you need to refresh the picturebox and/or set .AutoDraw = True

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Location
    Roodepoort, South Africa
    Posts
    472

    Re: Dynamically size controls for different screen resolutions

    No Picturebox. Controls just pasted into frame control.

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: Dynamically size controls for different screen resolutions

    There are drawing/painting issues with the frame control since W7.
    Best place a borderless picturebox in the frame, set the picturebox to match the interior size of the frame.
    Place all controls in the picturebox.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Location
    Roodepoort, South Africa
    Posts
    472

    Re: Dynamically size controls for different screen resolutions

    Tried putting picturebox in frame with controls in picturebox. Still same problem. Controls not showing and when changing to another form or program and returning to the program form has all the controls showing correctly

  6. #6
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: Dynamically size controls for different screen resolutions

    That's odd.
    Must be something else interfering!

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Location
    Roodepoort, South Africa
    Posts
    472

    Re: Dynamically size controls for different screen resolutions

    Seemed to have been a timing issue. When loaded from .Activate the problem arises and when loaded from .Load (with a DoEvents right after the load) it doesn't. The DoEvents didn't make a difference in .Activate.

    What is weird though is that it's only screens with frames that had the problem

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