delphi - How can I determine the input area size of a TEdit? -
it's easy outer dimensions of tedit control, includes bevel (or frame, depending on whether ctrl3d true or not). find out dimension , position of white input area of tedit.
i tried tedit.clientrect, seems give correct size if ctrl3d true. still have add 2 pixels left , top adjust bevel.
if ctrl3d false, size large 2 pixes , left / top offset must increased one.
is there way correct size , position of area, e.g. using windows api function?
on vista , higher, can use em_getrect
message:
function geteditrect(edit: tcustomedit): trect; begin sendmessage(edit.handle, em_getrect, 0, lparam(@result)); end;
unfortunately:
under conditions,
em_getrect
might not return exact valuesem_setrect
orem_setrectnp
set—it approximately correct, can off few pixels.
Comments
Post a Comment