checkbox com a propriedade transparent

Delphi

20/10/2005

galera, como eu poderia implementar a propriedade transparent do TCustomLabel no checkbox???


Zumbi

Zumbi

Curtidas 0

Respostas

Marcio.theis

Marcio.theis

20/10/2005

Se vc quiser pode baixar um componente com estar propriedades e outras neste [url=http://www.torry.ru/vcl/buttons/checkboxes/pdpcheck.zip]link[/url]


GOSTEI 0
_rodfaria_

_rodfaria_

20/10/2005

Combine um ´checkbox sem caption´ com um ´label transparent´ para ter o mesmo efeito
ou ainda, tente codificar o seu próprio componente:
[url]http://tinyurl.com/cvjs7[/url]

Rod.


GOSTEI 0
Zumbi

Zumbi

20/10/2005

Galera segue ai o codigo do componente de como ficou:

  finally 
    XCanvas.Free; 
    end;
end;

procedure TDBCheckBoxTransparent.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params); 
  Params.ExStyle:=Params.ExStyle or WS_EX_Transparent;
end;

procedure TDBCheckBoxTransparent.CreateWnd;
begin
  inherited CreateWnd; 
  SetButtonStyle;
end;

procedure TDBCheckBoxTransparent.SetButtonStyle;
const
  BS_MASK = $000F; 
var 
  Style: Word;
begin 
  if HandleAllocated then begin 
    Style:=BS_CHECKBOX or BS_OWNERDRAW;
    if GetWindowLong(Handle, GWL_STYLE) and BS_MASK <> Style 
      then SendMessage(Handle, BM_SETSTYLE, Style, 1); 
    end;
end;

end.



GOSTEI 0
POSTAR