I want the minimum width of SplitMenuButton's popup menu to be bound to the SplitMenuButton's widthProperty. When the width of the SplitMenuButton changes, the minimum width of the menu also changes. The desired effect is that the width of the menu will not be smaller than the width of the button. How to achieve it?
Asked
Active
Viewed 26 times
1
-
1`SplitMenuButton` is a bit different, but perhaps you could use a similar approach to this answer for [`ComboBox` popup width management](https://stackoverflow.com/a/22192990/1155209). – jewelsea Jan 13 '23 at 08:05
-
Thank you! But using CSS can only set a fixed value, I want its width to follow the SplitMenuButton change. There doesn't seem to be a way to change the width of the popup menu when it is created. – Hailong Liu Jan 19 '23 at 02:54
-
Provide an [mcve] if you would like additional assistance. – jewelsea Jan 19 '23 at 02:56