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.
however, when text extends label width text not aligned middle, top aligned instead.
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
Post a Comment