Windows窗体中的组合框 [英] combobox in windows form

查看:96
本文介绍了Windows窗体中的组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想下拉组合框,而不是像在Windows窗体中常规下拉框那样
应用

i want combo box to be drop up and not like regular drop down in windows form
application
so how can i go for this?

推荐答案

执行此操作的唯一方法是创建自.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!


这篇关于Windows窗体中的组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆