Solved

my problem...MDIchildCount!

Posted on 1998-02-17
1
354 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
Comment Utility
SpbtnSave.Enabled := MDIChildCount = 0;
SpbtnPrint.Enabled := MDIChildCount = 0;
SpbtnPaste.Enabled := MDIChildCount = 0;
SpbtnCut.Enabled := MDIChildCount = 0;
SpbtnCopy.Enabled := MDIChildCount = 0;
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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 article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

12 Experts available now in Live!

Get 1:1 Help Now