Thứ Tư, 23 tháng 1, 2008

Create XP Look for your application

Many application have "XP" themes. Look like MS Office XP. Look like this



To to this in delphi, it very simple. Download XPMenu from here :
http://www.shagrouni.com/download/xpmenu.zip

"XP Menu is a none-visual component that changes the visual aspects of menus, toolbars and many other controls to nearly the same look and feel of MS Office XP. No code required, you do not have to reconstruct menus or toolbars using controls other than those shipped with Delphi."

You can use this component in FREE/SHAREWARE/COMMERCIAL Software. It free :d

A sample example :
Put a menu, popup menu, some Button in form.

unit Unit1;

interface

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

type
TForm1 = class(TForm)
PopupMenu1: TPopupMenu;
File1: TMenuItem;
Exit1: TMenuItem;
N1: TMenuItem;
PrintSetup1: TMenuItem;
Print1: TMenuItem;
N2: TMenuItem;
SaveAs1: TMenuItem;
Save1: TMenuItem;
N3: TMenuItem;
Close1: TMenuItem;
Open1: TMenuItem;
New1: TMenuItem;
Edit1: TMenuItem;
Object1: TMenuItem;
Links1: TMenuItem;
N4: TMenuItem;
GoTo1: TMenuItem;
Replace1: TMenuItem;
Find1: TMenuItem;
N5: TMenuItem;
PasteSpecial1: TMenuItem;
Paste1: TMenuItem;
Copy1: TMenuItem;
Cut1: TMenuItem;
N6: TMenuItem;
Repeatcommand1: TMenuItem;
Undo1: TMenuItem;
Button1: TButton;
Button2: TButton;
XPMenu1: TXPMenu;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
XPMenu1.Active := TRUE;
end;

end.


Note : to apply XP themes to new menu item that create in runtime you can use :
XPMenu1.ActivateMenuItem(ThatMenuItem, TRUE);


Some other component that support menu themes :

BarMenu : http://www.bluecave.net/products/barmenus/
TBX : http://www.jrsoftware.org/tb2k.php (use it with they add-on)

Không có nhận xét nào: