Recent

Author Topic: TToolbutton: Dropdown menu aligned horizontally, is it possible?  (Read 242 times)

apeoperaio

  • Sr. Member
  • ****
  • Posts: 298
Hi,
Is it possible to have a dropdown menu for a TToolbutton that behaves like in the attached images?
Or should I use a different control?
I would like to have a menu with only images, not captions.

Any hint?
Thanks!

jamie

  • Hero Member
  • *****
  • Posts: 7774
Re: TToolbutton: Dropdown menu aligned horizontally, is it possible?
« Reply #1 on: May 11, 2026, 11:08:52 pm »
Yes, you can however, you need to create the actual floating tool windows and that can be done with a borderless form instructed to be shown on top and it should monitor the Keyboard and mouse input too, for off screen clicks or ESC key to auto close it like a menu would be etc.


 You can use the  OnConText event of the TToolButton to launch that window.

 You need to make that floating window with another form, design it and set it for non-visible when program starts up.


Jamie
The only true wisdom is knowing you know nothing

apeoperaio

  • Sr. Member
  • ****
  • Posts: 298
Re: TToolbutton: Dropdown menu aligned horizontally, is it possible?
« Reply #2 on: May 12, 2026, 11:16:26 am »
Thank you for the hint. I will try it.

Ten_Mile_Hike

  • Full Member
  • ***
  • Posts: 145
Re: TToolbutton: Dropdown menu aligned horizontally, is it possible?
« Reply #3 on: May 12, 2026, 02:52:24 pm »
Have you tried turning your screen on its side?   8-)

Sorry... beer makes me think I'm hilarious.
When any government, or any church for that matter, undertakes to say to its subjects, This you may not read, this you
must not see, this you are forbidden to know, the end result is tyranny and oppression no matter how holy the motives.

Robert A. Heinlein

apeoperaio

  • Sr. Member
  • ****
  • Posts: 298
Re: TToolbutton: Dropdown menu aligned horizontally, is it possible?
« Reply #4 on: May 12, 2026, 03:11:30 pm »
Quote
Have you tried turning your screen on its side?   8-)

I will  :D

Quote
Yes, you can however, you need to create the actual floating tool windows and that can be done with a borderless form instructed to be shown on top and it should monitor the Keyboard and mouse input too, for off screen clicks or ESC key to auto close it like a menu would be etc.

The behaviour should be the same as a popup menu, e.g., if i click outside the form/popup the form/popup should be closed. How could I do that?

 

TinyPortal © 2005-2018