开发者

How to disable Combobox slide animation effect in MFC?

Is there any way I can disable slide an开发者_如何学编程imation effect of a particular combo-box in MFC?

Generally combo-box slides downwards while opening, but if it doesn't fit into screen then it slides upwards. Can we override this default behavior and make combo-box slide upwards everytime?


Normally, a combobox control is considered to have a drop-down style. You appear to want consistent "drop-up" behavior instead. My initial thought was to change the DrawMode to Owner-Draw but this only gives you control over the visual aspect of each item; you actually want the selection rectangle to always appear above the drop-down arrow. However, changing the Dock property may do the trick. I suggest calling set_Dock() with a DockStyle of "Bottom": myDropUpComboBox.set_Dock(DockStyle.Bottom);

Another option is to create your own combobox-like class based upon the base control class. This would involve considerable code to mimic most of the standard behavior provided by a basic combobox.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜