Forum > KOL
KOL-CE Several Forms and Menus
tomcmok:
Hi,
This time a question about multiple form application and the TKOLMainMenu. I've got a Main Form with TKOLMainMenu with one item - "Exit" and I also have another form (say Form1) that user can open using a ListView item from the Main Form. Form1 has it's own TKOLMainMenu with one item as well - "Close". When this item is excecuted the code hides Form1. The strange thing is, that when Form1 disappers and we're back in the Main Form, the WinCE menu bar at the bottom still shows the "Close" item. Only when I activate some component on the Main Form (i.e. by clicking it) the menu shows correctly "Exit" item.
Any hints why it's like that?
Tomasz
yuriy_sydorov:
It seems to be a bug. But I always create and destroy modal forms dynamically and there is no such problem in this case.
tomcmok:
Yury,
Well, the project is now too advanced and changing the way forms are accessed is not an option. Can you suggest some way I can programatically activate the Main Form to make the proper menu appear. I've already tried FocusControl, Active := True, Show, but no success.
Tomasz
yuriy_sydorov:
I'll take a look on this problem...
tomcmok:
youry,
besides that problem, I've tried several ways of closing the current window. In Delphi I'd just do the following sequence: Create, Show, Close (that would trigger OnClose event which won't be triggered when I call hide) and eventually show again. In KOL-CE I've tried the below code:
if not Assigned( AForm ) then
NewAForm(AForm, Pointer(Applet));
AForm.Form.Show;
AForm.Form.Close; // The Menu bahaves correclty after that!
AForm.Form.Show;
...and application hangs on the last show :(
why it's like that?
Navigation
[0] Message Index
[#] Next page