There seems to be a similar question but it is not resolved.
I am using a ComboBox in my WinRT/C++ application and need to show the cursor as Hand while hovering over it. The issue is that while clicking on it, the cursor turns to arrow since PointerExited is fired. I had added code to change cursor to Hand when "PointerEntered" and arrow when "PointerExited".
This issue is seen only when IsEditable is set as False. When the bool flag is True, it works as expected.
I wish to workaround this unnecessary PointerExited firing, i.e, as long as I'm in the combobox area I want to show "Hand".
The Combobox is made of two main parts. One is a ContentPresenter
that shows the selected item, another is a PopUp
that shows the items. The PointerEntered event you are handling belongs to the ContentPresenter
part. When you click the Combobox and the PopUp
overlays on the ContentPresenter
part, the PointerExited will be fired because the cursor is entering the PopUp
. Currently, there is no way to avoid this behavior.
There is no perfect solution for this. A workaround is that you could handle the PointerEntered event of the ScrollViewer
which is inside the PopUp
. Change the cursor type into hands in that event like what you did in the PointerEntered event and **PointerExited ** event of the Combobox
.
Please check the following steps:
ComboBox
control from generic.xaml file and apply the style to your ComboBox
control.ScrollViewer
control in the added style, and add event handlers for PointerEntered event and PointerExited event.This is the basic steps, you might need to check other logic like selected item changes to make sure the cursor is in the correct type in such scenarios.