-
Sep 10th, 2014, 10:35 PM
#1
Thread Starter
Junior Member
Controls change size and position when displayed in a different tab
Hi,
I have several controls on a form which is fixed in size. I have several tabs on the same form and I need to display the same controls on different tabs depending on user selection. To achieve this, I use controls.add() to add each control to the respective tab and then I set the controls size using System.Drawing.Size and the location using System.Drawing.Point. This works fine on the computer that I compile and run the app on however when I run the same app on a different computer, the group box that the controls are inside is larger and the position of the group box is not where it should be. I presume this is happening because the size and x,y coordinates I am specifying are specific and not relative and are being interpreted differently for each platform? Is there a better way to position the controls so that the position is consistent across all platforms?
-
Sep 11th, 2014, 09:04 AM
#2
Re: Controls change size and position when displayed in a different tab
With windows form applications, if the DPI(Dots Per Inch) on the computers vary(which most likely they will) then the position/size of your controls will vary from monitor to monitor.
WPF uses device independent pixels which will determine the location/size that controls will appear on the different monitors.
My advice is if you want the location and size to be the same for each computer monitor, use WPF.
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
|