Click here to Skip to main content
15,885,216 members
Home / Discussions / C#
   

C#

 
GeneralRe: I need some help using Exchange EWS with C# Pin
turbosupramk322-Jun-16 13:03
turbosupramk322-Jun-16 13:03 
GeneralRe: I need some help using Exchange EWS with C# Pin
Dave Kreskowiak22-Jun-16 17:56
mveDave Kreskowiak22-Jun-16 17:56 
GeneralRe: I need some help using Exchange EWS with C# Pin
turbosupramk323-Jun-16 4:41
turbosupramk323-Jun-16 4:41 
GeneralRe: I need some help using Exchange EWS with C# Pin
turbosupramk323-Jun-16 5:05
turbosupramk323-Jun-16 5:05 
QuestionVS2015 designer resizes my main form on different development PCs Pin
LenHodder22-Jun-16 6:53
LenHodder22-Jun-16 6:53 
AnswerRe: VS2015 designer resizes my main form on different development PCs Pin
BillWoodruff22-Jun-16 18:12
professionalBillWoodruff22-Jun-16 18:12 
GeneralRe: VS2015 designer resizes my main form on different development PCs Pin
LenHodder23-Jun-16 0:38
LenHodder23-Jun-16 0:38 
AnswerRe: VS2015 designer resizes my main form on different development PCs Pin
Luc Pattyn23-Jun-16 11:12
sitebuilderLuc Pattyn23-Jun-16 11:12 
Hi,

What you describe resembles some of my earlier experiences with WinForms, although what follows actually applies to both dimensions; I would guess the horizontal effect is present but less noticeable due to the somewhat different aspect ratio of your monitors.

I am assuming your laptop and desktop use different resolutions, probably 100% (=96dpi) for the laptop and 125% (=120dpi) or more for the 4K desktop monitor. WinForms normally does some automatic scaling when you switch resolutions. It gets controlled mainly through the AutoScaleMode property of each Form you use.

Possible values are:

Inherit, which probably is fine for forms/Dialogs with a parent, not for the main Form; I never used it.
None, it disables all scaling attempts and leaves it all up to your code (not so easy to get something acceptable);
Font, the default, mostly fine if your app is text oriented;
Dpi, may well be the preferred one if your app is image oriented.

You're out of luck when both text and images are important to you!


What I typically end up doing when it is sufficiently important, is:
- use AutoScale.Dpi on every Form (the easiest is to inherit from a FormBase or a DialogBase that sets a number of things you want (or you want to experiment with) for all your forms;
- use the Anchor property to stretch 2D containers such as ListBox, TextBox, SplitContainer...;
- most often stretch the main Form (which has StartPosition: Manual) with constructor code similar to:
<br />
	InitializeComponent();<br />
	Rectangle wa=SystemInformation.WorkingArea;<br />
	Width=wa.Width-20;<br />
	Height=wa.Height-20;<br />
or something more sophisticated if you need to support multimonitor setups, or your app remembers its Location and Size on the local machine (registry, Properties, whatever).

BTW1: I don't use SplitContainer, it seems to have anchoring bugs; I use my own.
BTW2: I dislike UserControls, they have some quirky behavior too.
BTW3: And I don't use PictureBoxes, they are pretty useless, but their scaling might be correct, I couldn't tell...


Hope this helps.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

QuestionWhenever code shows "Console.WriteLine..." replace with textbox Pin
Agewiz22-Jun-16 6:46
Agewiz22-Jun-16 6:46 
QuestionRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
Eddy Vluggen22-Jun-16 7:00
professionalEddy Vluggen22-Jun-16 7:00 
AnswerRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
Agewiz22-Jun-16 11:50
Agewiz22-Jun-16 11:50 
AnswerRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
Afzaal Ahmad Zeeshan22-Jun-16 7:12
professionalAfzaal Ahmad Zeeshan22-Jun-16 7:12 
PraiseRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
Eddy Vluggen22-Jun-16 8:04
professionalEddy Vluggen22-Jun-16 8:04 
GeneralRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
Agewiz22-Jun-16 12:02
Agewiz22-Jun-16 12:02 
AnswerRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
Afzaal Ahmad Zeeshan22-Jun-16 12:04
professionalAfzaal Ahmad Zeeshan22-Jun-16 12:04 
AnswerRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
BillWoodruff22-Jun-16 19:23
professionalBillWoodruff22-Jun-16 19:23 
SuggestionRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
Richard Deeming23-Jun-16 2:09
mveRichard Deeming23-Jun-16 2:09 
GeneralRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
BillWoodruff23-Jun-16 3:05
professionalBillWoodruff23-Jun-16 3:05 
GeneralRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
Richard Deeming23-Jun-16 7:14
mveRichard Deeming23-Jun-16 7:14 
GeneralRe: Whenever code shows "Console.WriteLine..." replace with textbox Pin
BillWoodruff26-Jun-16 4:48
professionalBillWoodruff26-Jun-16 4:48 
QuestionDevExpress.XtraGrid.Views.Grid.GridView changing the data by Mouse Scrolling Pin
po_saa22-Jun-16 5:46
po_saa22-Jun-16 5:46 
AnswerREPOST Re: DevExpress.XtraGrid.Views.Grid.GridView changing the data by Mouse Scrolling Pin
Dave Kreskowiak22-Jun-16 6:01
mveDave Kreskowiak22-Jun-16 6:01 
QuestionMeaning of errors logged by FileSystemWatcher.Error Pin
srikrishnathanthri22-Jun-16 1:24
srikrishnathanthri22-Jun-16 1:24 
AnswerRe: Meaning of errors logged by FileSystemWatcher.Error PinPopular
Eddy Vluggen22-Jun-16 1:50
professionalEddy Vluggen22-Jun-16 1:50 
GeneralRe: Meaning of errors logged by FileSystemWatcher.Error Pin
srikrishnathanthri22-Jun-16 19:47
srikrishnathanthri22-Jun-16 19:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.