Board index » delphi » TForm.WindowMenu doesnt work

TForm.WindowMenu doesnt work

Hi!

I do exactly the following:
1) Create new application
2) Put a TMainMenu component on the main form (MainMenu1 on Form1)
3) Create 2 items in the menu: "Create" (for creating child forms) and
"Window"
4) Set Form1 properties: FormStyle=fsMDIForm and WindowMenu=Window1
5) Create new form (Form2)
6) Set its FormStyle to fsMDIChild
7) Remove it from the project's "auto-create forms" list
8) Write an event for "Create" menu item as follows: TForm2.Create(Self)
9) Run app
10) Create several instances of Form2

As I understand, the Window menu must get populated with new items, each
corresponding to an instance of TForm2. But it doesn't! Nothing happens at
all.
What did I do wrong?

Thanks,
Alexander

 

Re:TForm.WindowMenu doesnt work


Quote
In article <95uck5$e...@bornews.inprise.com>, Alexander Bach wrote:
> 1) Create new application
> 2) Put a TMainMenu component on the main form (MainMenu1 on Form1)
> 3) Create 2 items in the menu: "Create" (for creating child forms) and
> "Window"
> 4) Set Form1 properties: FormStyle=fsMDIForm and WindowMenu=Window1
> 5) Create new form (Form2)
> 6) Set its FormStyle to fsMDIChild
> 7) Remove it from the project's "auto-create forms" list
> 8) Write an event for "Create" menu item as follows: TForm2.Create(Self)
> 9) Run app
> 10) Create several instances of Form2

> As I understand, the Window menu must get populated with new items, each
> corresponding to an instance of TForm2. But it doesn't! Nothing happens at
> all.
> What did I do wrong?

You did not tell us which Delphi version you are using <G>.

This is a D5 problem, the new AutoHotkeys and AutoLinereduction properties
for the menu collide with the MDI systems menu handling. Set both properties
to manual.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: Till Feb.2001 i will only visit the groups on weekends, so  be patient
if i don't reply immediately.

Re:TForm.WindowMenu doesnt work


Thank you, Peter

I'm using Delphi 5, and due to your advise I resolved the problem

Alexander.

Re:TForm.WindowMenu doesnt work


Hi Alexander,

this happens when you set the AutoHotkeys-Property of the main menu
containing the window menu to True. The workaround is quite simple: In the
window menu add the menu hotkeys manually (adding the "&" to a different
character in each menu items caption) .

Then it will work fine :-)

Best regards
Frank :o)

"Alexander Bach" <al...@softhome.net> schrieb im Newsbeitrag
news:95uck5$eeu7@bornews.inprise.com...

Quote
> Hi!

> I do exactly the following:
> 1) Create new application
> 2) Put a TMainMenu component on the main form (MainMenu1 on Form1)
> 3) Create 2 items in the menu: "Create" (for creating child forms) and
> "Window"
> 4) Set Form1 properties: FormStyle=fsMDIForm and WindowMenu=Window1
> 5) Create new form (Form2)
> 6) Set its FormStyle to fsMDIChild
> 7) Remove it from the project's "auto-create forms" list
> 8) Write an event for "Create" menu item as follows: TForm2.Create(Self)
> 9) Run app
> 10) Create several instances of Form2

> As I understand, the Window menu must get populated with new items, each
> corresponding to an instance of TForm2. But it doesn't! Nothing happens at
> all.
> What did I do wrong?

> Thanks,
> Alexander

Other Threads