在Visual Studio中自动调整Combobox [英] autosize Combobox in Visual Studio

查看:139
本文介绍了在Visual Studio中自动调整Combobox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是C ++的初学者,我使用的是Visual Studio,我想创建一个非常小的组合框,但如果我点击它们,它们将会扩展,所以可以看到所有项目。我在这里找到了一个关于autosize的话题,但那是.NET,我不想依赖于.NET框架。所以你能告诉我怎么做吗?让我们从包含这些项目的组合框开始:所有,营房,铁匠,大学,修道院,所以我将初始宽度设置为23px,因此第一个项目all将被选中并且可见。

解决方案

你必须自己动手。 C ++没有.NET的舒适性,但允许实现很多东西。您必须为某些控制消息和一些控制通知。



看起来这里有一篇关于 Custom Comboboxes的有趣文章

I am beginner in C++, I am using Visual Studio and I would like to create combo boxes which will have very small with, but if I will click on them they will expand so all items can be seen. I found a topic here on "autosize" but that was .NET and I do not want to be depended on .NET framework. So can you show me how to do it? Lets start with combobox containing these items: "all", "barracks","blacksmith","university","monastery", so I would set the initial width to 23px, so the first item "all" will be selected and visible.

解决方案

you got to do it on your own. C++ hasnt the comfort of .NET but allows to implement much things. You must implement message handler for some the the Control Messages and some Control Notifications.

Looks like here is an interesting article about Custom Comboboxes.


这篇关于在Visual Studio中自动调整Combobox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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