-
Nov 11th, 2021, 02:59 AM
#1
Thread Starter
Hyperactive Member
[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?
-
Nov 11th, 2021, 03:54 AM
#2
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
-
Nov 11th, 2021, 04:12 AM
#3
Thread Starter
Hyperactive Member
Re: Dynamically size controls for different screen resolutions
No Picturebox. Controls just pasted into frame control.
-
Nov 11th, 2021, 04:22 AM
#4
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.
-
Nov 11th, 2021, 08:55 AM
#5
Thread Starter
Hyperactive Member
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
-
Nov 11th, 2021, 08:57 AM
#6
Re: Dynamically size controls for different screen resolutions
That's odd.
Must be something else interfering!
-
Nov 25th, 2021, 12:30 AM
#7
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|