开发者

allowing clicks on Button in ComboBoxItem when IsHitTestVisible is false

alt text开发者_JS百科 http://img375.imageshack.us/img375/9830/combobox.png

Setting the IsHitTestVisible="false" has the effect of having the whole ComboBox's drop area unresponsive to clicks. The same goes for setting to true.

With a ComboBox I don't have to create any storyboard to make ComboBox animation like but I found this issue.

How can one make the ComboBoxItem area unclickable except for the button within?


Sounds like you should be creating a custom control that uses a popup window, that just looks like a combobox, however you can do what you wanted:

  • Put your buttons inside a grid, inside a single RadComboBoxItem
  • Set the grid background colour to 1% alpha so it is hit-test visible yet unseen
  • Add a Grid_MouseLeftButtonUp event handlern to the grid
  • In the handler set e.Handled to true so the mouse up is eaten

Make sure you close the combobox popup when you get your button presses.

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜