谁知道在菜单中如何加入背景图片?

Tod 2001-07-26 02:46:33
...全文
218 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
Tod 2001-09-13
  • 打赏
  • 举报
回复
提前试试
Tod 2001-07-30
  • 打赏
  • 举报
回复
to OysterLQD:我看了看,确实有你说的那几个控件,不过不知道怎么用,我看了半天也没见有诸如picture或bitmap之类的属性,
您能介绍一下怎么用吗?非常感谢!
OysterLQD 2001-07-30
  • 打赏
  • 举报
回复
哦,传错了
OysterLQD 2001-07-30
  • 打赏
  • 举报
回复
偷懒了,你在下面的例子中找答案吧
unit Main;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw, ComCtrls, ShellCtrls, Grids,
Outline, DirOutln, ToolWin, ActnMan, ActnCtrls, ActnMenus, ActnList,
ExtCtrls,IdGlobal;

type
myfile=record
filename:string;
sequence:integer;
postfix:string;
end;
TForm1 = class(TForm)
ActionManager1: TActionManager;
ActionMainMenuBar1: TActionMainMenuBar;
ActionToolBar1: TActionToolBar;
Exit: TAction;
LocalFile: TAction;
OpenDialog1: TOpenDialog;
Panel1: TPanel;
Panel2: TPanel;
WebBrowser1: TWebBrowser;
Prev: TAction;
Next: TAction;
About: TAction;
procedure ExitExecute(Sender: TObject);
procedure LocalFileExecute(Sender: TObject);
procedure PrevExecute(Sender: TObject);
procedure NextExecute(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure AboutExecute(Sender: TObject);


private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
Files:array of myfile;
tmpfile:string;
fileprefix,filepostfix:string;
cur:integer;
sr:tsearchrec;
total,code:integer;
tmp:myfile;
implementation

{$R *.dfm}



procedure TForm1.ExitExecute(Sender: TObject);
begin
Close;
end;

procedure TForm1.LocalFileExecute(Sender: TObject);
var
loop,loop1:integer;
begin
total:=1;
setlength(files,1);
if opendialog1.Execute then
begin
tmpfile:=extractfilename(opendialog1.FileName);
//showmessage(tmpfile);
delete(tmpfile,pos('.',tmpfile),length(extractfileext(tmpfile)));
//showmessage(tmpfile);
for loop:=length(tmpfile) downto 1 do
begin
if not isnumeric(tmpfile[loop]) then
break;
end;
if loop=length(tmpfile) then
begin
files[0].filename:=opendialog1.filename;
files[0].sequence:=1;
files[0].postfix:='';
end
else
begin
if isnumeric(tmpfile[loop]) then
else
loop:=loop+1;
cur:=0;
fileprefix:=tmpfile;
delete(fileprefix,loop,length(fileprefix)-loop+1);
findfirst(fileprefix+'*'+extractfileext(opendialog1.FileName),faanyfile,sr);
files[0].filename:=sr.Name;
files[0].postfix:=tmpfile;
delete(files[0].postfix,1,loop-1);
val(files[cur].postfix,files[cur].sequence,code);
//showmessage(files[cur].postfix);

//showmessage(files[0].postfix);
while findnext(sr)=0 do
begin
total:=total+1;
setlength(files,total);
cur:=cur+1;
files[cur].filename:=sr.Name;
files[cur].postfix:= sr.Name;
delete(files[cur].postfix,1,loop-1);
delete(files[cur].postfix,pos('.',files[cur].postfix),length(extractfileext(opendialog1.FileName)));
val(files[cur].postfix,files[cur].sequence,code);
//showmessage(files[cur].postfix);
end;//while
//showmessage(files[0].filename);
end; //else
for loop:=0 to total-2 do
for loop1:=loop+1 to total-1 do
if files[loop].sequence>files[loop1].sequence then
begin
tmp:=files[loop];
files[loop]:=files[loop1];
files[loop1]:=tmp;
end;//if
for loop:=0 to total-1 do
if files[loop].filename=extractfilename(opendialog1.FileName) then
begin
cur:=loop;
break;
end;
webbrowser1.Navigate(opendialog1.FileName);
end; //if
end;

procedure TForm1.PrevExecute(Sender: TObject);
begin
if cur>0 then
begin
cur:=cur-1;
webbrowser1.Navigate(extractfilepath(opendialog1.FileName)+files[cur].filename);
end;
end;

procedure TForm1.NextExecute(Sender: TObject);
begin
//
if cur<total-1 then
begin
cur:=cur+1;
webbrowser1.Navigate(extractfilepath(opendialog1.FileName)+files[cur].filename);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
setlength(files,1);
total:=1;
end;

procedure TForm1.AboutExecute(Sender: TObject);
begin
showmessage('Copyright @ Oyster'+#13+#10+'All right reserved');
end;

end.
qiubolecn 2001-07-30
  • 打赏
  • 举报
回复
to OysterLQD,能显示图片,不能吧.我想应该在自绘事件里写, 这样的代码好多地方都有
Tod 2001-07-29
  • 打赏
  • 举报
回复
to OysterLQD:你说是真的吗?我去试试,要行那真感谢你了
OysterLQD 2001-07-27
  • 打赏
  • 举报
回复
用delphi6中的actionmanager,actionmainmenubar,actiontoolbar来做菜单,很容易就可以做到,只需改几个属性
yxjjx 2001-07-27
  • 打赏
  • 举报
回复
它有一个属性你找找就知道
Tod 2001-07-27
  • 打赏
  • 举报
回复
我要能做这样的控件也不必到这儿问了,你真逗!
wuyh78 2001-07-26
  • 打赏
  • 举报
回复
只能是自己再做增强的菜单控件了!
Tod 2001-07-26
  • 打赏
  • 举报
回复
没有人回答?
Tod 2001-07-26
  • 打赏
  • 举报
回复
我说不用其他的控件,在菜单的“条目”中加,即下拉的菜单中,不是菜单标题中,菜单标题中很简单。
jasmines 2001-07-26
  • 打赏
  • 举报
回复
use coolbar toolbar
jasmines 2001-07-26
  • 打赏
  • 举报
回复
在那里加???
菜单条上???

5,379

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧