View the side menu in a Form

Asked

Viewed 1,125 times

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 suggestions?

PS: The Mainmenu is a form Father and the form that is created when I click on its menu button inherits the form Father

2 answers

1


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

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

0

My suggestion is to keep the project only on fullscreen and take the buttons maximize the screen, can also make a precedent for when the screen is lowered.

  • The problem is that the ideal is that the screen does not get full screen 100% of the time

Browser other questions tagged

You are not signed in. Login or sign up in order to post.