1
votes

How would I go about implementing the Ctrl+F6 Next Window action in the Windows menu for an MDI application in Delphi 7?

3
Ummm.. I gave you exactly that in my answer. You then added "in the Windows menu" to your original post. Again, I'd already given you that in my answer. Is there something I'm missing here?Ken White

3 Answers

2
votes

Use the Next and Previous methods of the MDI parent window. You can do this from a menu event, and assign a shortcut like any other menu item. In the code below, the MDI parent form is TFormMDIParent, and it assumes you've created two menu items captioned "Next Child" and "Previous Child", leaving their names set to the default generated by the IDE. It also assumes that you've set the main form up correctly to be the MDI parent (FormStyle = fsMDIForm).

procedure TFormMDIParent.NextChild1Click(Sender: TObject);
begin
  Self.Next;
end;

procedure TFormMDIParent.PreviousChild1Click(Sender: TObject);
begin
  Self.Previous;
end;
1
votes

I don't think you need to do anything - it is implicit in MDI apps (created with the new MDI app wizard in Delphi 2006 anyway).

It also "just works" in an app the was originally created in Delphi 6 as well.

1
votes

Send the main form a wm_SysCommand message. Use sc_NextWindow or sc_PrevWindow for the wParam parameter.