c# - DialogUnits in .NET WinForms -




i'm porting old app .net, in there forms sizes set in dialog units.

int w = --- dialog definition int h = --- dialog definition 

i tried use such approach

int dx = (double)(loword(getdialogbaseunits())) / 4; int dy = (double)(hiword(getdialogbaseunits())) / 8; w *= dx; h *= dy; _form->clientsize = size::size(w, h); 

but .net form becomes way larger expected.

then tried use

rect rc = { _form->location.y, _form->location.x, _form->location.y + w, _form->location.x + h }; bool b = ::mapdialogrect((hwnd)_form->handle.toint32(), &rc); char err[1024]; getlasterrortext(getlasterror(), err, 1024); 

inside onload event, i'm getting error saying window not valid dialog, , rc variable remains un-changed.

how correctly transform du inside winforms application?

thx





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -