CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  界面

请问如何在ComboBox的非下拉框的位置作图!?

楼主suds(阿黑)2004-12-02 22:47:47 在 VC/MFC / 界面 提问

我想在ComboBox的非下拉列表框的位置作图(也就是高度位于下拉箭头的那个类似于EDIT的框内作图)。  
  可是每次画出来的东西都被系统自己画的那个EDIT框给抹掉了。  
  不知道有什么方法可以在这个位置作图!  
  谢谢! 问题点数:100、回复次数:4Top

1 楼vcleaner(我没当大哥很久了.......)回复于 2004-12-03 08:43:42 得分 20

关注一下吧,呵呵,控件也是窗口,应该可以的Top

2 楼suds(阿黑)回复于 2004-12-03 08:53:36 得分 0

哈哈哈!欧已经搞定了。  
  Application   developers   do   not   need   to   implement   IAccessible   to   expose   the   items   in   an   owner-drawn   combo   box   that   has   the   style   CBS_HASSTRINGS   because   Active   Accessibility   exposes   the   items   in   combo   boxes   with   this   style.   The   items   in   an   owner-drawn   combo   box   with   the   CBS_HASSTRINGS   style   are   displayed   as   text.   However,   this   style   is   also   used   with   owner-drawn   combo   boxes   that   do   not   display   text   so   that   the   combo   box   items   are   exposed   by   Active   Accessibility.  
   
  To   allow   Active   Accessibility   to   expose   the   items   in   an   owner-drawn   combo   box   that   does   not   display   text:    
   
  Use   the   CBS_HASSTRINGS   style   when   creating   the   combo   box.    
  Create   a   textual   counterpart   that   names   or   describes   each   item   in   the   combo   box.    
  When   adding   items   to   the   owner-drawn   combo   box,   use   the   CB_ADDSTRING   message   to   add   the   text   that   you   want   Active   Accessibility   to   expose.   This   text   is   not   displayed,   so   it   must   not   be   part   of   the   owner-drawn   data.   Add   the   owner-drawn   item   data   using   the   CB_SETITEMDATA   message.    
  When   using   the   above   method,   note   the   following:    
   
  If   you   use   the   CBS_SORT   style,   the   combo   box   is   sorted   using   the   supplied   strings   and   not   the   WM_COMPAREITEM   callback   procedure.    
  With   owner-drawn   variable   combo   boxes   created   with   the   style   CBS_OWNERDRAWVARIABLE,   use   a   global   variable   or   some   other   mechanism   to   keep   track   of   when   the   itemData   member   of   the   MEASUREITEMSTRUCT   is   valid.   The   global   variable   is   required   because   the   system   sends   the   WM_MEASUREITEM   message   as   soon   as   the   string   is   added   but   before   the   item   data   is   attached,   and   at   this   point   the   itemData   member   is   not   valid.    
  To   change   the   string   for   an   item   in   a   combo   box   with   the   CBS_HASSTRINGS   style,   delete   the   item   with   the   CB_DELETESTRING   message   and   add   the   new   string   with   the   CB_ADDSTRING   message.    
   
  可不可以给自己加分呀!  
  呵呵!Top

3 楼lzzqqq(Jonersen)回复于 2004-12-03 08:54:24 得分 80

既然是combobox自己有个子Edit.  
  那么你应该在这个Edit上画图才对。  
  因为这个Edit拿combobox来当容器。而edit有自己的onpaint处理。  
  要不然就自己继承一个Edit,在这个edit里画上图。来代替combobox里的Edit.Top

4 楼suds(阿黑)回复于 2004-12-03 08:55:56 得分 0

5555  
  不能给自己分呢!  
  Top

相关问题

  • ComboBox画图
  • combobox
  • combobox
  • 怎样在对话框的任意位置显示图标?
  • 如何实现ComboBox选择位图名并显示在对话框中
  • 对话框条上加ComboBox后怎么往ComboBox里加item
  • 请问如何获得combobox(droplist) 中某字符串的位置值?谢谢
  • 请问:非MFC程序中,如何自行设置ComboBox下拉列表框的位置(主要是指left,而非width)?应该处理什么窗口的什么消息?怎么实现?
  • 关于ComboBox的问题,如何让ComboBox带图片?
  • 关于ComboBox的边框问题

关键词

  • active
  • drawn
  • hasstrings
  • combo box
  • combobox
  • cb
  • owner
  • expose
  • edit
  • 位置作图

得分解答快速导航

  • 帖主:suds
  • vcleaner
  • lzzqqq

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo