Home > Back-end >  Consult ace about repeat the problem of dynamically generated menu
Consult ace about repeat the problem of dynamically generated menu

Time:09-20

Procedure TfmMainForm. Image5Click (Sender: TObject);
Var
Independence idx: integer;
The begin
{if fmMainForm. MDIChildCount> 0 then the Begin
For independence idx:=fmMainForm. Downto MDIChildCount - 1 0 do
FmMainForm. MDIChildren [independence idx]. Free;
end; }

ClearFuncItem;
ModDataWriteMenu (MainMenu1 ADOQryTmp, TImage (Sender). The Tag);
StatusBar1. Panels [3]. The Text:=TImage (Sender). Hint.
end;

Procedure TfmMainForm. ClearFuncItem;
Var
MuIdx: integer;
The begin
For MuIdx:=MainMenu1. Downto Items. The Count - 1 0 do begin
If (MainMenu1. Items [MuIdx] Tag> 0) and (MainMenu1. Items [MuIdx] Tag<999999) then the begin
MainMenu1. Items. The Delete (MuIdx);
end;
end;
SD. UpdateMainMenu (True);
end;
In child form open, dynamically generated menu will appear the phenomenon of repeated loading, if all the child form is closed, the generated menu everything is normal, this is what reason is caused? Note: use the TSkinData controls

CodePudding user response:

Do you have a look at the child form the menu has a corresponding operation lead to

CodePudding user response:

Child form is used to perform specific affairs, does not involve the menu operation

CodePudding user response:

Master it, move a look

CodePudding user response:

Debugging, line, and see where the problem is, can also move the menu operation code, debugging in a new program, narrow range,

CodePudding user response:

Whether you want to add a search menu have been added to the code, when not to join, add menu item,

CodePudding user response:

The newly created controls will automatically have a name, if you look at the name repeated

CodePudding user response:

Add again before judging, have and then skip is added
  • Related