procedure TForm3.FormActivate(Sender: TObject); var
MItem: TMenuItem;
i:integer;
begin
for i:=0 to form1.componentcount-1 do
begin
if form1.components[i] is tmenuitem then
tmenuitem(form1.components[i]).visible:=false;
end;
for i:=0 to 0 do
begin
MItem:=FindComponent('qq1') as TMenuItem;
MItem.Visible := True;
end;
end;
我这个 菜单是( MItem) 属于 form1(主窗体的) 所以
for i:=0 to 0 do
begin
MItem:=FindComponent('qq1') as TMenuItem;
MItem.Visible := True;
end; 应该是不行
可是我这样写: for i:=0 to 0 do
begin
form1.MItem:=FindComponent('qq1') as TMenuItem;
form1.MItem.Visible := True;
end;也不行啊!
各位大哥 ,怎样写啊?谢谢!
MItem: TMenuItem;
i:integer;
begin
for i:=0 to form1.componentcount-1 do
begin
if form1.components[i] is tmenuitem then
tmenuitem(form1.components[i]).visible:=false;
end;
for i:=0 to 0 do
begin
MItem:=FindComponent('qq1') as TMenuItem;
MItem.Visible := True;
end;
end;
我这个 菜单是( MItem) 属于 form1(主窗体的) 所以
for i:=0 to 0 do
begin
MItem:=FindComponent('qq1') as TMenuItem;
MItem.Visible := True;
end; 应该是不行
可是我这样写: for i:=0 to 0 do
begin
form1.MItem:=FindComponent('qq1') as TMenuItem;
form1.MItem.Visible := True;
end;也不行啊!
各位大哥 ,怎样写啊?谢谢!
解决方案 »
- 大家一起来翻译几个api
- 如何全面实现高效, 快速的半透明窗体,或控件
- 高分求教…………
- 问如何注册imgscan.ocx imgadmin.ocx imgedit.ocx imgthumb.ocx(在线急候~~~!)
- 请各位高手指点,很急!!!!!!!!!!!!!
- 请问delphi+ado操作dbf数据库时如何使用临时表?
- Timage控件问题!
- 一个delphi的报表打印问题,多谢!
- 好久没来了,没分散。露个脸。
- 帮我看看这段线程的代码??????icehill
- 我想把字节数组s:Array of Byte中的指定位置的流(例如从3到6)拷贝到字节数组m中,不知该如何做呢
- 怎样把两个维数,元素个数,类型都相同的数组互相赋值
if FindComponent('Menu') is TMainMenu then
if TMainMemu(FindComponent('Menu')).FindComponent('qq1') <>nil then
TMenuItem(TMainMemu(FindComponent('Menu')).FindComponent('qq1')).Visible:=True;