- UID
- 6411
- 积分
- 60
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-6-13
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2004-2-1 12:12:10
|
显示全部楼层
这个问题已经解决,发出来与大家共享!
1。在AutoDesk的网上是这样讨论的:
Posted by: Rizzo, Jon
Date: Sep/09/02 - 09:46 (GMT)
I am having a problem with an owner drawn combo box.
In my OnInitDialog(), I am adding code to an instance of my combo box class.
When I call AddString(), the function executes, but it appears to store a
garbage string, instead of the string that is passed.. The same garbage
string can be retrieved using GetLBText(), so the problem appears to be in
storing the string, rather than displaying it.
What I am trying to do is not complicated, and I tested the code outside of
AutoCAD (in a dialog based application) & did not have the same problem. I
added a CAcModuleResourceOverride object to the command that calls this
dialog, but that did not help.
Any ideas what could be causing this problem, or how to fix it?
Thanks in advance,
Jon Rizzo
Langan Engineering and Environmental Services, Inc.
-----------------------------------------------------------------------------------
Reply From: Blattel, Byron
Date: Sep/09/02 - 09:53 (GMT)
Re: Problem with owner drawn combo box
If you are creating it via CComboBox::Create() don't forget to use
CBS_HASSTRINGS...
|
----+---------------------------------------------- ------------------------------------------------
实际上的做法是要确保你的对话框中ComboBox控件设置
CBS_OwnerDraw 选“否“,CBS_HasString选“false".
2。经过本人认真研究ObjectARX的例题,在VStudio.net中用
Wizard后,加入的ComboBox的默认高度是12,这个值太小了,
在OnInitDialog后根本显不出来,修改如下。
打开*.rc文件,找到如下代码
COMBOBOX IDC_COMBO1,48,12,27,12,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
将其中的后一个 12 改写为大一些的值,100就行!这四个数分
别代表了起点的x坐标,y坐标,长度和高度。 |
|