Panel as menu

  • Thread starter Thread starter Szymon Kosok
  • Start date Start date
S

Szymon Kosok

Hello,

I want to make menu with panel component, but i have one big problem.
If user click outside panel, it (panel not user lol) must be hidden.
(just like main menu component) It's there way to make it possible?

Best regards,
Szymon Kosok
 
Hello,
I want to make menu with panel component, but i have one big problem.
If user click outside panel, it (panel not user lol) must be hidden.
(just like main menu component) It's there way to make it possible?

Best regards,
Szymon Kosok

You could listen to Mouseclick-Messages in the WndProc funtion and check
if the position the user clicked at is outside your panel.
 
Szymon Kosok said:
I want to make menu with panel component, but i have one big problem.
If user click outside panel, it (panel not user lol) must be hidden.
(just like main menu component) It's there way to make it possible?

I think you should write your own panel and override OnMouseLeve event and
add Visible = false there. Moreover you will probably need to add some
protection against hiding the panel when control inside panel is entered by
mouse cursor (because panel's OnMouseLeve event will be rised then too). I
think you can combine MainMenu with Panel(s) i.e. when MenuIem is clicked
you can show your panel Panel below MenuItem that was clicked.

PZDR PSG
 
Back
Top