How do i custom draw of TEdit control text?

后端 未结 4 1508
生来不讨喜
生来不讨喜 2021-01-14 01:09

I\'d like to draw a piece of TEdit.Text using Font.Color different from the default. Are there any examples how to do that?

I\'m attempting to do something like thi

4条回答
  •  自闭症患者
    2021-01-14 01:27

    Another small improvement by overriding the CreateParams procedure which fixes the flickering during text selection (mouse move while left button down):

    procedure TMyEdit.CreateParams(var Params: TCreateParams);
    begin
        inherited;
        if csDesigning in ComponentState then
            exit;
        Params.ExStyle := Params.ExStyle or WS_EX_COMPOSITED;
    end;
    

提交回复
热议问题