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
  #2  
Antiguo 29-05-2015
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Poder: 23
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
sac,

Cita:
Empezado por sac
...crear un procedure donde le pueda asignar propiedades Name, Color, Size y Style a una fuente...


Revisa este código:
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Edit1: TEdit;
    Memo1: TMemo;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure ChangeFont(F : TFont; Name : String; Color : TColor; Size : Byte; Style : TFontStyles);
begin
   F.Name := Name;
   F.Color := Color;
   F.Size := Size;
   F.Style := Style;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
   S : String;

begin

   S := 'Ejemplo de cambio de propiedades de un Font';

   Label1.Caption := S;
   Edit1.Text := S;
   Memo1.Lines.Add(S)

end;

procedure TForm1.Button1Click(Sender: TObject);
var
   FontName : String;
   FontColor : TColor;
   FontSize : Byte;
   FontStyle : TFontStyles;

begin

   FontName := 'Arial';;
   FontColor := clNavy;
   FontSize := 12;
   FontStyle := [];

   ChangeFont(Label1.Font, FontName, FontColor, FontSize, FontStyle);
   ChangeFont(Edit1.Font, FontName, FontColor, FontSize, FontStyle);
   ChangeFont(Memo1.Font, FontName, FontColor, FontSize, FontStyle);

end;

procedure TForm1.Button2Click(Sender: TObject);
var
   FontName : String;
   FontColor : TColor;
   FontSize : Byte;
   FontStyle : TFontStyles;

begin

   FontName := 'Arial Rounded MT';
   FontColor := clGreen;
   FontSize := 10;
   FontStyle := [fsBold];

   ChangeFont(Label1.Font, FontName, FontColor, FontSize, FontStyle);
   ChangeFont(Edit1.Font, FontName, FontColor, FontSize, FontStyle);
   ChangeFont(Memo1.Font, FontName, FontColor, FontSize, FontStyle);

end;

procedure TForm1.Button3Click(Sender: TObject);
var
   FontName : String;
   FontColor : TColor;
   FontSize : Byte;
   FontStyle : TFontStyles;

begin

   FontName := 'Elephant';
   FontColor := clBlue;
   FontSize := 10;
   FontStyle := [fsItalic, fsUnderline];

   ChangeFont(Label1.Font, FontName, FontColor, FontSize, FontStyle);
   ChangeFont(Edit1.Font, FontName, FontColor, FontSize, FontStyle);
   ChangeFont(Memo1.Font, FontName, FontColor, FontSize, FontStyle);

end;

end.
El código anterior en Delphi 7 sobre Windows 7 Professional x32, Permite modificar selectivamente las propiedades de un TFont, como se muestra en la siguiente imagen:



Espero sea útil

Nelson.

Última edición por nlsgarcia fecha: 29-05-2015 a las 20:28:52.
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
agregar fonts Celta Varios 3 14-03-2011 23:34:19
Fonts en mi Aplicación Ledian_Fdez Varios 1 07-05-2010 01:16:24
como cambio propiedades de la impresora omy Impresión 3 12-01-2009 18:13:57
como crear fonts para windows? Citlalli Varios 1 24-11-2006 02:30:48
InstallShield + instalar fonts miguelb Varios 1 16-07-2003 06:32:21


La franja horaria es GMT +2. Ahora son las 22:58:06.


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