c# - AutoEllipsis=true affects the vertical positioning of the text -


i have label autoellipsis = true , textalign = contentalignment.middleleft. when enter text not extending label width, text vertically aligned middle of label.

enter image description here

however, when text extends label width text not aligned middle, top aligned instead.

enter image description here

why behaving way, , there way keep text vertically center aligned?

i see it. looks limitation in underlying winapi, drawtextex(). doesn't lot of label class, doesn't turn on dt_singleline option (aka textformatflags.singleline) since capable of rendering multiple lines. drawtextex() documents required vertically centered text (dt_vcenter). real bug shouldn't centered @ :) note do centered text when grow label vertically.

the simplest way work around setting label's usecompatibletextrendering property true.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -