开发者

PageControl disabled text on tabs - gray text

I am looking (I think) for the Windows API that I can use in my OnDrawTab event in the TPageControl component to display gray text on tabs that I choose. I have done it in the past and from memory this is where I did (in the OnDrawTab event). Unfortunately I don't have access to the code to look back how I did it before.

I'm sure that I used something like DrawText or TextOut or something but I was able to add a flag or format style to it which gave it the appearance of grayed out. For the life of me I cannot find the command I used. ODS_DISABLED flag seems to be something like what I'm after but it is a windows message handler so I'm sure I didn't use that before. I'm not writing a component here, just handling the OnDrawTab event.

Anyone point me in the right direction?

I'm using Delphi 6.

Than开发者_JAVA百科ks

Jason


You can use the DrawState and GrayString functions.

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜