Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
MdFontbox.pas
Package: delphi.rar [view]
Upload User: fh681027
Upload Date: 2022-07-23
Package Size: 1959k
Code Size: 2k
Category:
Delphi VCL
Development Platform:
Delphi
- unit MdFontbox;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
- type
- TMdFontCombo = class(TComboBox)
- private
- FChangeFormFont: Boolean;
- procedure SetChangeFormFont(const Value: Boolean);
- public
- constructor Create (AOwner: TComponent); override;
- procedure CreateWnd; override;
- procedure Change; override;
- published
- property Style default csDropDownList;
- property Items stored False;
- property ChangeFormFont: Boolean
- read FChangeFormFont write SetChangeFormFont
- default True;
- end;
- procedure Register;
- implementation
- procedure Register;
- begin
- RegisterComponents('Md', [TMdFontCombo]);
- end;
- { TMdFontCombo class }
- procedure TMdFontCombo.Change;
- begin
- // assign the font to the owner form
- if FChangeFormFont and Assigned (Owner) and (Owner is TForm) then
- TForm (Owner).Font.Name := Text;
- inherited;
- end;
- constructor TMdFontCombo.Create (AOwner: TComponent);
- begin
- inherited Create (AOwner);
- Style := csDropDownList;
- FChangeFormFont := True;
- end;
- procedure TMdFontCombo.CreateWnd;
- begin
- inherited CreateWnd;
- Items.Assign (Screen.Fonts);
- // grab the default font of the owner form
- if FChangeFormFont and Assigned (Owner) and (Owner is TForm) then
- ItemIndex := Items.IndexOf (
- (Owner as TForm).Font.Name);
- end;
- procedure TMdFontCombo.SetChangeFormFont(const Value: Boolean);
- begin
- FChangeFormFont := Value;
- // refresh font
- if FChangeFormFont then
- Change;
- end;
- end.