Side Menu Display on a Form

0

I have a form that displays a side menu according to this code:

procedure TFMainMenu.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
   Y: Integer);
begin
PanelMenu.Visible := (Mouse.CursorPos.X < FMainMenu.Width -(0.95*FMainMenu.Width) )
end;

The problem is that when the form is not full screen, this side menu does not appear using this function. Any suggestion?

PS: The MainMenu is a parent form, and the form that is created when I click the button on the menu inherits the Parent     

asked by anonymous 11.07.2014 / 19:45

2 answers

1

The problem is that you are using the absolute mouse position in Mouse.CursorPos.X instead of using the X parameter with the relative position of the mouse. Therefore:

procedure TFMainMenu.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
   Y: Integer);
begin
PanelMenu.Visible := (X < FMainMenu.Width -(0.95*FMainMenu.Width) )
end;
    
11.07.2014 / 20:36
0

My suggestion is to keep the project only in fullscreen and take the buttons to maximize the screen, you can also make a procedure for when the screen is dimmed.

    
11.07.2014 / 20:30