Solved

my problem...MDIchildCount!

Posted on 1998-02-17
1
357 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now