Click here to Skip to main content
15,891,423 members
Home / Discussions / C#
   

C#

 
GeneralRe: Inserting Through Radionbutton and checkbox Pin
Luc Pattyn26-Mar-22 9:24
sitebuilderLuc Pattyn26-Mar-22 9:24 
AnswerRe: Inserting Through Radionbutton and checkbox Pin
Craig Robbins26-Mar-22 3:36
Craig Robbins26-Mar-22 3:36 
GeneralRe: Inserting Through Radionbutton and checkbox Pin
N Mohamed rafi26-Mar-22 5:16
N Mohamed rafi26-Mar-22 5:16 
GeneralRe: Inserting Through Radionbutton and checkbox Pin
Craig Robbins26-Mar-22 12:42
Craig Robbins26-Mar-22 12:42 
Questionhow get dpi scale factor Pin
Le@rner22-Mar-22 21:29
Le@rner22-Mar-22 21:29 
AnswerRe: how get dpi scale factor Pin
Victor Nijegorodov22-Mar-22 22:28
Victor Nijegorodov22-Mar-22 22:28 
AnswerRe: how get dpi scale factor Pin
Richard MacCutchan22-Mar-22 22:36
mveRichard MacCutchan22-Mar-22 22:36 
GeneralRe: how get dpi scale factor Pin
Le@rner22-Mar-22 23:16
Le@rner22-Mar-22 23:16 
GeneralRe: how get dpi scale factor Pin
Richard MacCutchan22-Mar-22 23:19
mveRichard MacCutchan22-Mar-22 23:19 
GeneralRe: how get dpi scale factor Pin
Le@rner22-Mar-22 23:20
Le@rner22-Mar-22 23:20 
GeneralRe: how get dpi scale factor Pin
Richard MacCutchan22-Mar-22 23:30
mveRichard MacCutchan22-Mar-22 23:30 
GeneralRe: how get dpi scale factor Pin
Le@rner23-Mar-22 0:00
Le@rner23-Mar-22 0:00 
GeneralRe: how get dpi scale factor Pin
Richard MacCutchan23-Mar-22 0:23
mveRichard MacCutchan23-Mar-22 0:23 
GeneralRe: how get dpi scale factor Pin
Dave Kreskowiak23-Mar-22 2:49
mveDave Kreskowiak23-Mar-22 2:49 
GeneralRe: how get dpi scale factor Pin
Le@rner23-Mar-22 17:55
Le@rner23-Mar-22 17:55 
GeneralRe: how get dpi scale factor Pin
Dave Kreskowiak24-Mar-22 6:47
mveDave Kreskowiak24-Mar-22 6:47 
QuestionRe: how get dpi scale factor Pin
Eddy Vluggen22-Mar-22 23:45
professionalEddy Vluggen22-Mar-22 23:45 
AnswerRe: how get dpi scale factor Pin
JudyL_MD24-Mar-22 6:15
JudyL_MD24-Mar-22 6:15 
GeneralRe: how get dpi scale factor Pin
Randor 24-Mar-22 20:49
professional Randor 24-Mar-22 20:49 
Judy,

Great answer, I hope to see you answering more C# related questions in the future. Smile | :)

The Windows API equivalent to what you are doing there would be calling the GetDpiForMonitor function[^] and obtaining the MDT_EFFECTIVE_DPI[^] value and dividing by the system default. Of course the operating system hides dpi/scaling values from threads unless it's DPI aware[^]. So the caller needs to set thread DPI awareness before performing the calculation.

I'd like to add that GetScaleFactorForMonitor[^] may return incorrect values. The manual calculation is preferred.

I'd also like to add that the process doesn't necessarily need to be DPI aware. Beginning with Win10 1607 you can create a DPI aware thread to get those values by using the SetThreadDpiAwarenessContext function[^].

Hope to see you answering more often!

Best Wishes,
-David Delaune
QuestionPassword CAPS not Checking in my code Pin
N Mohamed rafi22-Mar-22 21:08
N Mohamed rafi22-Mar-22 21:08 
AnswerRe: Password CAPS not Checking in my code Pin
OriginalGriff22-Mar-22 21:10
mveOriginalGriff22-Mar-22 21:10 
GeneralRe: Password CAPS not Checking in my code Pin
N Mohamed rafi23-Mar-22 0:56
N Mohamed rafi23-Mar-22 0:56 
GeneralRe: Password CAPS not Checking in my code Pin
OriginalGriff23-Mar-22 1:18
mveOriginalGriff23-Mar-22 1:18 
GeneralRe: Password CAPS not Checking in my code Pin
Dave Kreskowiak23-Mar-22 2:46
mveDave Kreskowiak23-Mar-22 2:46 
GeneralRe: Password CAPS not Checking in my code Pin
N Mohamed rafi25-Mar-22 22:56
N Mohamed rafi25-Mar-22 22:56 

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.