PageControl has disabled tab text - gray text

I am looking for (I think) a Windows API that I can use in my OnDrawTab event in the TPageControl component to display gray text on the tabs that I select. I have done this in the past, and from memory, this is what I did (in the OnDrawTab event). Unfortunately, I do not have access to the code to look back, as I did before.

I'm sure I used something like DrawText or TextOut or something else, but I was able to add a flag or format style to it that gave it a gray look. For the life of me, I cannot find the team I used. The ODS_DISABLED flag seems to be something like what I need, but it's a Windows message handler, so I'm sure I haven't used it before. I am not writing a component here, just handling the OnDrawTab event.

Does anyone point me in the right direction?

I am using Delphi 6.

thank

Jason

+3
source share
1 answer

You can use DrawStateand GrayString.

procedure TForm1.FormClick(Sender: TObject);
var
  s: string;
begin
  s := 'testar';
  DrawState(Canvas.Handle,
            0,
            nil,
            integer(@s[1]),
            length(s),
            10,
            10,
            0,
            0,
            DST_TEXT or DSS_DISABLED)
end;
+4
source

Source: https://habr.com/ru/post/1780557/


All Articles