如何更快的加载阵列的字符串组合框在MFC? [英] How to load string of array in to combobox faster in MFC?

查看:173
本文介绍了如何更快的加载阵列的字符串组合框在MFC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有1000的字符串数组如何加载它们组合框快似样倾销中,而不是迭代呢?
而到了组合框的数据复制到一些其他10个组合框?

I have an array of 1000 strings how to load them in to combo box faster like kind of dumping in to rather than iterating it? And to copy the combo box data to some 10 other combo box?

推荐答案

如果你有1000个字符串10组合框重复,你可能要考虑使用一个所有者绘制组合框的基础上的指数纳入其中借鉴了飞弦你阵列,而不是在组合框中存放它们。方式速度更快,方式更多的内存效率。退房的 DRAWITEM 的在线帮助的方法和 DRAWITEMSTRUCT 的结构。基本上,你会喜欢用做点什么 InitStorage InsertString (由NuSonic提到的)在你的combobx创建1000空白项目,并覆盖 DRAWITEM 提取和绘制所需的串,根据索引,因为它需要绘制

If you have 1,000 strings repeated in 10 comboboxes, you may want to consider using an owner drawn combobox, which draws the strings on the fly based on indices into your array, rather than storing them in the combobox at all. Way faster, way more memory efficient. Check out the DrawItem method and DRAWITEMSTRUCT structure in the on-line help. Basically, you would do something like using InitStorage and InsertString (as mentioned by NuSonic) to create your 1000 blank items in your combobx, and override DrawItem to extract and draw the required string, based on index, as it needs to be drawn.

这篇关于如何更快的加载阵列的字符串组合框在MFC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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