且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows窗体中的组合框

更新时间:2023-12-06 11:19:52

执行此操作的唯一方法是创建自.Net组合框派生的自定义控件.

编辑==================

我可以详细说明吗?是的-Google是您的朋友.编写自定义控件的过程和技巧超出了快速答案"的范围.您必须了解几乎所有有关控件如何工作以及如何更改控件以执行所需操作的所有知识.这不是一件容易的事,即使是最有经验的程序员也会对前景有所畏缩.如果您四处逛逛(使用Google),您可能会发现一个自定义组合框已经可以完成您想要的操作.
The only way you can do this is to create your own custom control that''s derived from the .Net combobox.

EDIT ===================

Can I elaborate? Yeah - google is your friend. The process and art of writing a custom control is WAY beyond the scope of a "quick answer". You have to understand pretty much everything there is to know about how a control works, and how to change it to do what you want. It''s not an easy task, and even the most experienced programmers flinch a little at the prospect. If you look around (using google), you might find a custom combobox that already does what you want.


说实话,这可能比它麻烦得多.的价值.

您将必须基于ComboBox创建自定义控件,并捕获Windows消息 CB_GETDROPPEDCONTROLRECT [ ^ ]返回不同的矩形-即控件上方而不是下方.

我从来没有尝试过-从来没有想要过,现在也没有-但它应该可以工作.

祝你好运!
To be honest, it''ll probably be a lot more trouble than it''s worth.

You would have to create a custom control based on a ComboBox, and trap the windows message CB_GETDROPPEDCONTROLRECT[^] to return a different rectangle - i.e. above the control rather than below.

I''ve never tried it - never wanted to, nor do I now - but it should work.

Good luck!