Função pede integer! (DrawState)

Delphi

15/09/2005

Ola pessoal, tenho um problema...

Qdo colocamos o [b:03c44a920a]&[/b:03c44a920a] na frente do Caption para fazer o atalho, já fica assim:
Exemplo:
&Teste -> [u:03c44a920a]T[/u:03c44a920a]este


estou com um problema nesse componente herdado do TButton, ele na hora de ficar desabilitado,
nao fica sublinhada a letra, aparece o & ...

Acontece q a função que coloca a imagem desabilitada pede um Integer para inserir o Caption.
Acho que na hora q ele converte a String do caption para Integer, dá errado...

esse é o trecho do código onde tem as funções.
[   if IsDisabled then
   DrawState(FCanvas.Handle, FCanvas.Brush.Handle, nil, Integer(Caption), 0,
    ((Rect.Right - Rect.Left) - FCanvas.TextWidth(Caption)) div 2,
    ((Rect.Bottom - Rect.Top) - FCanvas.TextHeight(Caption)) div 2,
    0, 0, DST_TEXT or DSS_DISABLED)
  else
   DrawText(FCanvas.Handle, PChar(Caption), - 1, Rect,
   DT_SINGLELINE or DT_CENTER or DT_VCENTER);
   SetBkMode(FCanvas.Handle, OldMode);


A sintaxe das funções:
function DrawState(DC:HDC; Brush: HBRUSH; CBFunc: Pointer; lData: Integer; wData: Integer; x: Integer; y: Integer; cx: Integer; cy: Integer; Flags: Cardinal): LongBool;

function DrawText(hDC:HDC; lpString: PAnsiChar; nCount:Integer; var lpRect: TRect; uFormat: Cardinal): Integer;



Alguem tem alguma ideia?


Michelli88

Michelli88

Curtidas 0

Respostas

Michelli88

Michelli88

15/09/2005

up


GOSTEI 0
Rjun

Rjun

15/09/2005

Que erro está dando?


GOSTEI 0
Massuda

Massuda

15/09/2005

...Alguem tem alguma ideia?
Inclua a flag DST_PREFIXTEXT na chamada a DrawState...
DrawState(... 
    DST_TEXT or DSS_DISABLED or DST_PREFIXTEXT) 



GOSTEI 0
Michelli88

Michelli88

15/09/2005

Isso galera, o DST_PREFIXTEXT resolveu, mas eu tive q tirar o DST_TEXT!!!
Valeu!


GOSTEI 0
POSTAR