求XP菜单原码 不用VCL,完全用API实现的那种。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我有一个,不过delphi7不是有吗? 看看这个是不是你需要的:http://www.shagrouni.com/english/software/xpmenu.html XPmenu这个控件适合你的要求吗? http://www.shagrouni.com/english/software/xpmenu.html这个我有了。 Delphi 6 XP-Style ActionBands要不? Delphi 7 的ActionBar可以直接设成XPStyle 只要完全用API实现的哦!别用DELPHI自带的东东。其实是想要XP实现的原理。给我DELPHI的例子,也没有用1 http://www.vcfan.com/delphi/kongjian.asp?subject_name=kongjian unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, ImgList, StdCtrls;type TForm1 = class(TForm) MainMenu1: TMainMenu; ImageList1: TImageList; AAA1: TMenuItem; BBB1: TMenuItem; N1: TMenuItem; CCC1: TMenuItem; DDDD1: TMenuItem; SSSS1: TMenuItem; DSAA1: TMenuItem; PopupMenu1: TPopupMenu; ZZZZ1: TMenuItem; XXXX1: TMenuItem; CCCCC1: TMenuItem; N3: TMenuItem; N4: TMenuItem; N2: TMenuItem; procedure FormCreate(Sender: TObject); procedure CCC1DrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; Selected: Boolean); procedure CCC1MeasureItem(Sender: TObject; ACanvas: TCanvas; var Width, Height: Integer); procedure Button1Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure BBB1Click(Sender: TObject); private FSelColor,FBdyColor,FIcnColor,FFntColor:TColor; { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);begin FBdyColor:=$00F0E1E1;//整体的颜色,没有选择时的颜色 FIcnColor:=$00BBD7FF;//图表背景的颜色 FFntColor:=$00000024;//字体的颜色 FSelColor:=$00FFD8CE;//选择时的颜色end;procedure TForm1.CCC1DrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; Selected: Boolean);var MenuItem:TMenuItem; IcnRect,TxtRect:TRect; Txt:String; B:TBitmap; Icount:integer; IsTopItem:Boolean;begin MenuItem:=Sender as TMenuItem; Txt:=MenuItem.Caption; IcnRect:=Rect(ARect.Left,ARect.Top, ARect.Left+20,ARect.Bottom);//goto: TxtRect:=Rect(ARect.Left+22,ARect.Top,ARect.Right,ARect.Bottom); IsTopItem:=False; if IsTopItem then begin ACanvas.Brush.Color:=clBtnFace; ACanvas.Pen.Color:=clBtnFace; ACanvas.Rectangle(IcnRect); end else begin ACanvas.Brush.Color:=FIcnColor; ACanvas.Pen.Color:=FIcnColor; ACanvas.Rectangle(IcnRect); ACanvas.Brush.Color:=FBdyColor; ACanvas.Pen.Color:=FBdyColor; end; //ACanvas.Rectangle(Arect); //ACanvas.Brush.Color:=FBdyColor; //ACanvas.Pen.Color:=FBdyColor; ACanvas.Rectangle(TxtRect.Left-2,TxtRect.Top,TxtRect.Right,TxtRect.Bottom); if Selected then //判断是否选中.选种画椭圆。 begin ACanvas.Brush.Color:=FSelColor; ACanvas.Pen.Color :=clBlack; ACanvas.RoundRect(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom,7,7); end; if Txt='-' then //对文字的处理 begin ACanvas.Pen.Width :=1; ACanvas.Pen.Color:=clGray; ACanvas.MoveTo(TxtRect.Left -1 ,TxtRect.Top+(TxtRect.Bottom-TxtRect.Top) div 2); ACanvas.LineTo(TxtRect.Right-2 ,TxtRect.Top+(TxtRect.Bottom-TxtRect.Top) div 2); end else begin //文字被覆盖时: ACanvas.Font.Size:=8; if MenuItem.Enabled then ACanvas.Font.Color:=FFntColor else ACanvas.Font.Color:=clGray; SetBkMode(ACanvas.Handle,OPAQUE); //GOTO: //重新填充文字,也就是在MenuItem里 DrawText(ACanvas.Handle, //的文字区域写文字。 Pchar(Txt), Length(Txt), TxtRect, DT_VCenter or DT_SingleLine or DT_LEFT); end; if MenuItem.Checked then //菜单被选择的时候 begin ACanvas.Pen.Color :=clGray; //画个边框而已 ACanvas.Pen.Width :=1; //上半部分 ACanvas.Polyline([Point(IcnRect.Left+2 ,IcnRect.Bottom-2), //GOTO: Point(IcnRect.Left+2 ,IcnRect.Top+2 ), Point(IcnRect.Right-2,IcnRect.Top+2 )]); //此函数是依据点来连线,有多少连多少 ACanvas.Pen.Color :=clWhite; ACanvas.Pen.Width :=1; ACanvas.Polyline([Point(IcnRect.Right-2,IcnRect.Top+2 ), Point(IcnRect.Right-2,IcnRect.Bottom-2), //下半部分 Point(IcnRect.Left+2 ,IcnRect.Bottom-2)]); ACanvas.Pen.Color :=clRed ; //产生影印的效果 ACanvas.Pen.Width :=2; ACanvas.Polyline([Point(IcnRect.Left+4 ,IcnRect.Top+10 ), Point(IcnRect.Left+8 ,IcnRect.Top+14 ), Point(IcnRect.Right-5,IcnRect.Top+5 )]); end else if (MenuItem.GetParentMenu.Images<>nil)and(Txt<>'-') then //图标被覆盖时: begin B:=TBitmap.Create; B.Transparent:=True;//透明而已 MenuItem.GetParentMenu.Images.GetBitmap(MenuItem.ImageIndex,B); //goto: IcnRect:=Rect(IcnRect.Left+2,IcnRect.Top+2,IcnRect.Right-2,IcnRect.Bottom-2);//缩小图标的面积 ACanvas.StretchDraw(IcnRect,B); //在长方型的框内,画图 B.Free; end;end;procedure TForm1.CCC1MeasureItem(Sender: TObject; ACanvas: TCanvas; var Width, Height: Integer);var Txt:String;begin // 在Application.Run 之前运行 ACanvas.Font.Size:=8; Txt:=(Sender as TMenuItem).Caption; //得到tet,等数据循环进行。 Width :=ACanvas.TextWidth(Txt)+20; Height:=ACanvas.TextHeight(Txt)+6; if Txt='-' then Height:=ACanvas.TextHeight(Txt) div 2;end;procedure TForm1.Button1Click(Sender: TObject);begin BBB1.Checked:=False;end;procedure TForm1.N4Click(Sender: TObject);begin N4.Enabled:=False;end;procedure TForm1.BBB1Click(Sender: TObject);begin BBB1.Checked:=not BBB1.Checked;end;end. 请问我已经受冬添加了一个线程的文件并在线程当中实现了下载功能。 在delphi中实现无标题窗体的移动最简单的方法 关于字符串的问题(VB ->Delphi ) 如何得到某一网页的头部信息呢? AnimalsC:Array[1..3] of string=('中国','国家','天空') 为什么不能这样初始化? 怎么样用声卡采集到我说的声音 代码如何简写? ini文件问题。 怎么监视任务栏的改变?Kingron请来拿分 由 TCustomControl 派生出来的控件如何响应右键 SQL语句中如果条件中带有'",等字符会出错,这样的语句该怎样写? 很简单,如何得到当前的时间和日期?(在线等待)
http://www.shagrouni.com/english/software/xpmenu.html
要不?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, ImgList, StdCtrls;type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
ImageList1: TImageList;
AAA1: TMenuItem;
BBB1: TMenuItem;
N1: TMenuItem;
CCC1: TMenuItem;
DDDD1: TMenuItem;
SSSS1: TMenuItem;
DSAA1: TMenuItem;
PopupMenu1: TPopupMenu;
ZZZZ1: TMenuItem;
XXXX1: TMenuItem;
CCCCC1: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N2: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure CCC1DrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect;
Selected: Boolean);
procedure CCC1MeasureItem(Sender: TObject; ACanvas: TCanvas; var Width,
Height: Integer);
procedure Button1Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure BBB1Click(Sender: TObject);
private
FSelColor,FBdyColor,FIcnColor,FFntColor:TColor;
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
FBdyColor:=$00F0E1E1;//整体的颜色,没有选择时的颜色
FIcnColor:=$00BBD7FF;//图表背景的颜色
FFntColor:=$00000024;//字体的颜色
FSelColor:=$00FFD8CE;//选择时的颜色
end;procedure TForm1.CCC1DrawItem(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; Selected: Boolean);
var
MenuItem:TMenuItem;
IcnRect,TxtRect:TRect;
Txt:String;
B:TBitmap;
Icount:integer;
IsTopItem:Boolean;
begin MenuItem:=Sender as TMenuItem;
Txt:=MenuItem.Caption;
IcnRect:=Rect(ARect.Left,ARect.Top, ARect.Left+20,ARect.Bottom);//goto:
TxtRect:=Rect(ARect.Left+22,ARect.Top,ARect.Right,ARect.Bottom);
IsTopItem:=False;
if IsTopItem then
begin
ACanvas.Brush.Color:=clBtnFace;
ACanvas.Pen.Color:=clBtnFace;
ACanvas.Rectangle(IcnRect);
end
else
begin
ACanvas.Brush.Color:=FIcnColor;
ACanvas.Pen.Color:=FIcnColor;
ACanvas.Rectangle(IcnRect);
ACanvas.Brush.Color:=FBdyColor;
ACanvas.Pen.Color:=FBdyColor;
end;
//ACanvas.Rectangle(Arect);
//ACanvas.Brush.Color:=FBdyColor;
//ACanvas.Pen.Color:=FBdyColor;
ACanvas.Rectangle(TxtRect.Left-2,TxtRect.Top,TxtRect.Right,TxtRect.Bottom);
if Selected then //判断是否选中.选种画椭圆。
begin
ACanvas.Brush.Color:=FSelColor;
ACanvas.Pen.Color :=clBlack;
ACanvas.RoundRect(ARect.Left,ARect.Top,ARect.Right,ARect.Bottom,7,7);
end;
if Txt='-' then //对文字的处理
begin
ACanvas.Pen.Width :=1;
ACanvas.Pen.Color:=clGray;
ACanvas.MoveTo(TxtRect.Left -1 ,TxtRect.Top+(TxtRect.Bottom-TxtRect.Top) div 2);
ACanvas.LineTo(TxtRect.Right-2 ,TxtRect.Top+(TxtRect.Bottom-TxtRect.Top) div 2);
end
else
begin //文字被覆盖时:
ACanvas.Font.Size:=8;
if MenuItem.Enabled then
ACanvas.Font.Color:=FFntColor
else
ACanvas.Font.Color:=clGray;
SetBkMode(ACanvas.Handle,OPAQUE); //GOTO: //重新填充文字,也就是在MenuItem里
DrawText(ACanvas.Handle, //的文字区域写文字。
Pchar(Txt),
Length(Txt),
TxtRect,
DT_VCenter or DT_SingleLine or DT_LEFT); end;
if MenuItem.Checked then //菜单被选择的时候
begin
ACanvas.Pen.Color :=clGray; //画个边框而已
ACanvas.Pen.Width :=1; //上半部分
ACanvas.Polyline([Point(IcnRect.Left+2 ,IcnRect.Bottom-2), //GOTO:
Point(IcnRect.Left+2 ,IcnRect.Top+2 ),
Point(IcnRect.Right-2,IcnRect.Top+2 )]); //此函数是依据点来连线,有多少连多少
ACanvas.Pen.Color :=clWhite;
ACanvas.Pen.Width :=1;
ACanvas.Polyline([Point(IcnRect.Right-2,IcnRect.Top+2 ),
Point(IcnRect.Right-2,IcnRect.Bottom-2), //下半部分
Point(IcnRect.Left+2 ,IcnRect.Bottom-2)]);
ACanvas.Pen.Color :=clRed ; //产生影印的效果
ACanvas.Pen.Width :=2;
ACanvas.Polyline([Point(IcnRect.Left+4 ,IcnRect.Top+10 ),
Point(IcnRect.Left+8 ,IcnRect.Top+14 ),
Point(IcnRect.Right-5,IcnRect.Top+5 )]);
end else if (MenuItem.GetParentMenu.Images<>nil)and(Txt<>'-') then //图标被覆盖时:
begin
B:=TBitmap.Create;
B.Transparent:=True;//透明而已
MenuItem.GetParentMenu.Images.GetBitmap(MenuItem.ImageIndex,B); //goto:
IcnRect:=Rect(IcnRect.Left+2,IcnRect.Top+2,IcnRect.Right-2,IcnRect.Bottom-2);//缩小图标的面积
ACanvas.StretchDraw(IcnRect,B); //在长方型的框内,画图
B.Free;
end;
end;procedure TForm1.CCC1MeasureItem(Sender: TObject; ACanvas: TCanvas;
var Width, Height: Integer);
var
Txt:String;
begin // 在Application.Run 之前运行
ACanvas.Font.Size:=8;
Txt:=(Sender as TMenuItem).Caption; //得到tet,等数据循环进行。
Width :=ACanvas.TextWidth(Txt)+20;
Height:=ACanvas.TextHeight(Txt)+6;
if Txt='-' then
Height:=ACanvas.TextHeight(Txt) div 2;end;procedure TForm1.Button1Click(Sender: TObject);
begin
BBB1.Checked:=False;
end;procedure TForm1.N4Click(Sender: TObject);
begin
N4.Enabled:=False;
end;procedure TForm1.BBB1Click(Sender: TObject);
begin
BBB1.Checked:=not BBB1.Checked;
end;end.