Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #10  
Antiguo 26-05-2010
Avatar de José Luis Garcí
[José Luis Garcí] José Luis Garcí is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Las Palmas de G.C.
Posts: 1.372
Poder: 25
José Luis Garcí Va camino a la fama
Te pongo el código que uso para lo siguiente

Código Delphi [-]

procedure TFprincipal.ColorBox2Click(Sender: TObject);
//-------------------------------------------------------------------------------
//***********************************************[color del fondo]****
//-------------------------------------------------------------------------------
var
  Format: CHARFORMAT2;
begin
  FillChar(Format, SizeOf(Format), 0);
  with Format do
  begin
    cbSize := SizeOf(Format);
    dwMask := CFM_BACKCOLOR;
    crBackColor := ColorBox2.Selected;
    redtrededitcion.Perform(EM_SETCHARFORMAT, SCF_SELECTION, Longint(@Format));
  end;
end;

procedure TFprincipal.ColorBox1Click(Sender: TObject);
//-------------------------------------------------------------------------------
//*****************************************************[ELEGIMOS COLOR texto]****
//-------------------------------------------------------------------------------
begin
redtrededitcion.SelAttributes.Color := ColorBox1.Selected;
end;

procedure TFprincipal.btn5Click(Sender: TObject);
//-----------------------------------------------------------------------------
//**************************************************[ Justificar Texto  ]******
//-----------------------------------------------------------------------------
begin
   if Length(redtrededitcion.selText)>0 then JustifyRichEdit(redtrededitcion,FAlse)
                                        else JustifyRichEdit(redtrededitcion,True);
end;


// AllText : True=todo o texto; False=parágrafo atual
procedure JustifyRichEdit(RichEdit :TRichEdit; AllText :Boolean);
const
  TO_ADVANCEDTYPOGRAPHY   = $1;
  EM_SETTYPOGRAPHYOPTIONS = (WM_USER + 202);
  EM_GETTYPOGRAPHYOPTIONS = (WM_USER + 203);
var
  ParaFormat :TParaFormat;
  SelStart,
  SelLength :Integer;
begin
  ParaFormat.cbSize := SizeOf(ParaFormat);
  if SendMessage(RichEdit.handle,
              EM_SETTYPOGRAPHYOPTIONS,
              TO_ADVANCEDTYPOGRAPHY,
              TO_ADVANCEDTYPOGRAPHY) = 1 then
  begin
    SelStart := RichEdit.SelStart;
    SelLength := RichEdit.SelLength;
    if AllText then
      RichEdit.SelectAll;
    ParaFormat.dwMask := PFM_ALIGNMENT;
    ParaFormat.wAlignment := PFA_JUSTIFY;
    SendMessage(RichEdit.handle, EM_SETPARAFORMAT, 0, LongInt(@ParaFormat));
// Restaura seleção caso tenhamos mudado para All
    RichEdit.SelStart := SelStart;
    RichEdit.SelLength := SelLength;
  end;
end;

procedure TFprincipal.ColorBox3Change(Sender: TObject);
//-----------------------------------------------------------------------------
//*****************************************[ Color de Fondo del Editor  ]******
//-----------------------------------------------------------------------------
begin
   redtrededitcion.Color:=ColorBox3.Selected;
end;

Espero os sirva
__________________
Un saludo desde Canarias, "El abuelo Cebolleta"
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
RTF en Richedit f_cbuilder6 C++ Builder 0 20-05-2007 19:08:20
Parte de un RichEdit a otro RichEdit (donde esté el cursor) Tomy Varios 3 21-12-2005 21:08:15
RichEdit ivet OOP 1 26-06-2005 20:47:38
Tab en RichEdit Sonic C++ Builder 8 23-11-2004 12:40:05
RichEdit. Tonio Varios 1 25-06-2003 19:50:04


La franja horaria es GMT +2. Ahora son las 16:59:59.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi