Solved

my problem...MDIchildCount!

Posted on 1998-02-17
1
363 Views
Last Modified: 2011-10-03
procedure TFrameForm1.UpdateMenuItems(Sender: TObject);
begin

SpbtnSave.Enabled := MDIChildCount > 0;
SpbtnPrint.Enabled := MDIChildCount > 0;

SpbtnPaste.Enabled := MDIChildCount > 0;
SpbtnCut.Enabled := MDIChildCount > 0;
SpbtnCopy.Enabled := MDIChildCount > 0;

if MDIChildCount = 0 then
  LockWindowUpdate(Handle);
  StatusBar1.Panels[0].Text := 'Row: 0' ;
  StatusBar1.Panels[1].Text := 'Col: 0' ;
  LockWindowUpdate(0);

end;

procedure TFrameForm1.FormCreate(Sender: TObject);
begin
Application.OnHint := MyHint;
Screen.OnActiveFormChange := UpdateMenuItems;
end;

procedure TEditForm1.Close1Click(Sender: TObject);
begin
Close;

end;

procedure TEditForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
 Action := caFree;

end;


i cannot detect MDIcHILD Count properly..can anyone help?
my toolbar  buttons are not disenabled properly..
if MDIChildCount = 1 then my toolbars buttons are
enabled..which should be disenable...
0
Comment
Question by:cooldude77
1 Comment
 
LVL 5

Accepted Solution

by:
ronit051397 earned 30 total points
ID: 1359494
SpbtnSave.Enabled := MDIChildCount = 0;
SpbtnPrint.Enabled := MDIChildCount = 0;
SpbtnPaste.Enabled := MDIChildCount = 0;
SpbtnCut.Enabled := MDIChildCount = 0;
SpbtnCopy.Enabled := MDIChildCount = 0;
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question