Programming => General => Topic started by: Gald on October 24, 2020, 07:05:26 pm
Title: About using Panel as Button [SOLVED]
Post by: Gald on October 24, 2020, 07:05:26 pm
Hello! Im trying to use Panel as Button, but there are a few problems with that.
I know, Panel can receive focus by the code: "Panel1.TabStop := True".
But how to simulate an event like "onGetFocus and OnLoseFocus" for doing some changes on appearance and also to receive keyboard actions like [Enter] and [Space] to activate their onClick event?
Title: Re: About using Panel as Button
Post by: jamie on October 24, 2020, 07:16:44 pm
try setfocus
Title: Re: About using Panel as Button
Post by: Blaazen on October 24, 2020, 07:18:50 pm
Events you are looking for are OnEnter and OnExit. TPanel has key events, but they are not published, you have to assign them by code.