组合框不显示数据项 [英] Combobox not displaying the data items

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

问题描述

在设计时,我一直在尝试通过在该组合框的Data属性中设置以分号分隔的字符串,在我的mfc项目的DialogWindow中为组合框添加Data项.

I have been trying to add Data items for my combobox in the DialogWindow of my mfc project, at design time by setting strings delimited by semi-colons for the Data property of this combobox.

但是它仅在运行时显示空的组合框.我也尝试在DialogBox的OnInitDialog()事件中手动使用此组合框的AddString()方法.但这也不起作用.

But it just shows empty combobox at runtime. I tried using AddString() method of this combobox manually in the OnInitDialog() event of the DialogBox too. But that was also not working.

试图再次创建一个演示项目,当我添加组合框并将值a;b放在其Data属性中时,它就会显示出来.但是在我的项目上尝试了同样的方法,它仍然在新的组合框中显示空列表!试图比较两个项目的代码,例如头文件和初始化的代码等.发现两者是相同的.除了按钮中的一些事件声明和项目中的自定义c ++代码外,其余代码与新创建的演示项目中的代码相同!

Tried creating a demo project again and when I added the combobox and put the value a;b in the Data property of it, it is showing up. But tried the same on my project and it is still showing the empty list in the new combobox! Tried to compare both project's code, like the header files and initialization's etc. Found that both are same. Other than some event declaration for the buttons and my custom c++ code in my project, the rest of the code is same as that of the newly created demo project!

为什么在我的项目中此组合框显示了一个空项目列表? :(

Why in my project this combobox is showing an empty list of items? :(

仅注意到项目已在列表中.但是下拉菜单的高度很小,因此阻止了实际物品的显示! :(

Just noticed that the items are already in the list. But the dropdown is of small height and thus preventing the actual items from showing up! :(

试图增加组合框的大小,但是我无法在属性窗口"中找到任何属性,并且拖动组合框的角也不会增加组合框的高度! :(

Tried to look increasing the size of the combobox, but I couldn't find any property in the Property Window and dragging the corners of th combobox doesn't increases the height either! :(

推荐答案

在设计窗口中按如下所示增加下拉列表的大小:

Increase the size of the dropdown list like this, in the design window:

单击组合框右侧的箭头(在第一个图片上以黄色突出显示).然后单击并拖动底部的中间大小调整标记以增加高度(在第二张图片中突出显示).

Click on the arrow on the right side of the combobox (highlighted in yellow on first pic). Then click and drag the bottom mid resize marker to increase the height (highlighted in the second pic).

这将增加下拉列表的大小.

This will increase the size of the dropdown list.

否则,当我们尝试单击调整大小标记以增加高度时,它将被禁用.因此,请确保先单击组合框右侧的箭头.

Otherwise when we try to click on the resize markers to increase the height, it would be disabled. So make sure you click on the arrow on the right side of the combobox first.

这篇关于组合框不显示数据项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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