在delphi7要实现XP效果的方式,简单省心的大致有以下三种:(当然用第三方控件除外)
1、就是将WIN32下的XPMainFest放入界面中,即会产生XP效果代码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, XPMan, StdCtrls, Buttons;
type
TForm1 = class(TForm)
XPManifest1: TXPManifest; //这里表示已加了此控件
BitBtn1: TBitBtn;
Button1: TButton;
private { Private declarations }
public { Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.
2、第二种就是在uses里加上XPman从而调用C:/Program Files/Borland/Delphi7/Lib/XPman.dcu实现XP效果,代码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, XPMan, StdCtrls, Buttons;//在USES中加上了XPMan
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
Button1: TButton;
private { Private declarations }
public { Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.
3、第三种方法即是将windowsXP.res编译到程序中实现XP效果,即在代码中加入{$R WindowsXP.res}这样就可以将C:/Program Files/Borland/Delphi7/Lib/windowsXP.res文件编译到程序中,代码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
Button1: TButton;
private { Private declarations }
public { Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{$R WindowsXP.res} //在这里加上{$R WindowsXP.res}
end.