Jump to content

How this error message is produced?


gywlx
 Share

Recommended Posts

procedure TMainAreaForm.NavTreeViewClick(Sender: TObject);
var
 s, sn, strSheetName:string;
 uts:TUniTabSheet;
 I: Integer;
begin
 s := NavTreeView.Selected.Text;

 if s='主界面' then
   sn := 'Main'
 else
 if s='考勤登记' then
   sn := 'WorkRecord'
 else
 if s='销售分析' then
   sn := 'SaleTotal'
 else
 if s='注销离开' then
 begin
   UniApplication.Terminate;
   exit;
 end
 else
   sn := 'Main';


 strSheetName := sn+'Sheet';

 for I := 0 to NavPage.PageCount - 1 do
 begin
   uts := NavPage.Pages[i];
   if uts.Name=strSheetName then
   begin
     NavPage.ActivePage := uts;
     NavPageChange(NavPage);
     exit;
   end;
 end;

 uts := TUniTabSheet.Create( NavPage );
 uts.Caption := s;
 uts.Name := strSheetName;
 uts.PageControl := NavPage;
 NavPage.ActivePage := uts;
 NavPageChange(NavPage);

 InsertFrame(NavPage.ActivePage, sn);
end;

procedure TMainAreaForm.btnCloseSheetClick(Sender: TObject);
var
 I: Integer;
begin
 NavPage.ActivePage.Free;
 if NavPage.ActivePage=MainSheet then
   btnDelSheet.Visible := False;
 for I := 0 to NavTreeView.Items.Count - 1 do
   if NavTreeView.Items.Item[i].Text=NavPage.ActivePage.Caption then
   begin
     NavTreeView.Items.Item[i].Selected := True;
     Break;
   end;
end;

post-70-0-30698000-1313033214_thumb.jpg

post-70-0-37886700-1313033488_thumb.png

post-70-0-69725300-1313033499_thumb.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...