Ver Mensaje Individual
  #6  
Antiguo 02-05-2006
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Reputación: 31
Lepe Va por buen camino
Pues si tengo un ejemplito hecho... ahí va:

tb son botones de un Toolbar que tienen la propiedad Grouped a True para cambiar la negrita, subrayado, alineado, etc.

Código Delphi [-]
procedure TFrmReport.tbnegritaClick(Sender: TObject);
begin
if (fsbold in rich.SelAttributes.Style) then
  rich.SelAttributes.Style:=  rich.SelAttributes.Style - [fsbold]
else
  rich.SelAttributes.Style:=  rich.SelAttributes.Style + [fsbold];

tbnegrita.Down:=(fsbold in rich.SelAttributes.Style)
end;


procedure TFrmReport.RichSelectionChange(Sender: TObject);
var indicetemp:integer;
begin

case ord(rich.Paragraph.Alignment) of
  0: tbleft.down:=true;
  1: tbright.Down:=true;
  2: tbcenter.down:=true;
  else
  begin
    tbright.Down:=false;
    tbcenter.Down:=false;
    tbleft.Down:=false;
  end;
end;


tbnegrita.Down:=(fsbold in rich.SelAttributes.Style);
tbsubrayado.Down:=(fsUnderline in rich.SelAttributes.Style);
tbcursiva.down:=(fsitalic in rich.SelAttributes.Style);


end; //richselectionchange;

Saludos
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.
Responder Con Cita