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

可恶的老外,这么好的控件(ICONMENU)竟然不支持中文,请高手解决!!!!!!!!

楼主OLD_VB_FAN(蓝星)2001-07-02 18:19:39 在 VB / 控件 提问

网站上发现了一个很小的,能比ACTIVEBAR更快捷地创建带图标菜单的控件--->ICONMENU,IMAGELIST中的每个图标对应一个菜单条的CAPTION(标题),用英文可以顺利地将图标(BMP)加到菜单中,但我试了很多次,该控件就是不支持中文菜单条标题(CAPTION),请高手倾力指点如何解决。  
   
  该控件比较容易操作,很简单,远比ACTIVEBAR容易,所以我很想使用它,而且可以用它直接利用工具条的IMAGELIST,一举两得呀。  
   
  该控件(含示例源代码)下载处:  
  http://202.103.176.84/erun/adamyl/vbcontrols/download/im209.zip 问题点数:130、回复次数:16Top

1 楼iProgram(na)回复于 2001-07-02 18:30:35 得分 20

试试在添加中文的代码的中文后加上chr(0),入:  
  xx.AddCaption("中文Caption"   &   chr(0))Top

2 楼huanggx(大侠)回复于 2001-07-02 18:31:13 得分 20

已经有破解了吗?Top

3 楼OLD_VB_FAN(蓝星)回复于 2001-07-02 19:25:44 得分 0

to   iProgram(赶快去掉这鬼东西):不用写代码,直接在IMAGELIST中将菜单条的标题(CAPTION)与每一个图标(BMP)相对应即可,英文标题菜单没问题,中文的则图标无法显示,而其他效果均可以使用。  
  TO:huanggx(大侠):我下载的好象没有限制呀! Top

4 楼OLD_VB_FAN(蓝星)回复于 2001-07-02 22:08:19 得分 0

@_@Top

5 楼huanggx(大侠)回复于 2001-07-02 22:12:01 得分 15

我下载了你上面公布的那个im209.zip,里面的例程在我的机器上看不见菜单。但把鼠标放到菜单的位置,能看到突起的按钮。一点就会导致vb6出错,被系统杀掉。  
  我的环境是win2000sp2,   中文vb6   sp5Top

6 楼huangguanshu()回复于 2001-07-02 22:29:29 得分 20

这个东西我试过了,在我的机器上里面的例程一运行就出错,自己写的亦出错。  
  可能Win2000用不到,我的环境和大侠一样。Top

7 楼joeking(只是喜欢动手罢了)回复于 2001-07-03 01:54:16 得分 20

笨方法:如果把CAPTION直接写到图片里呢?用一个图象编辑软件可以做到,对不对?  
  我没有下,也不想试,我对别人的控件不感兴趣,除非真的有用,呵呵。Top

8 楼OLD_VB_FAN(蓝星)回复于 2001-07-03 09:13:33 得分 0

TO   joeking(天龙):菜单条的标题(CAPTION)Top

9 楼OLD_VB_FAN(蓝星)回复于 2001-07-03 10:28:44 得分 0

@_@Top

10 楼OLD_VB_FAN(蓝星)回复于 2001-07-03 20:11:18 得分 0

Question:   how   to   make   the   iconmenu   control   to   support   chinese   menuitem's   caption?     Date:   07/02/2001   06:40AM   PST          
  From:   new_fan  
  Status:   Waiting   for   Answer     Points:   100  
    Email   A   Friend      
  I   downloaded   the   control   and   its   sample   codes   in   the   site   as   below:  
  http://202.103.176.84/erun/adamyl/vbcontrols/download/im209.zip  
   
  use   this   control,   you   can   add   bmp   image   into   the   menuitem   easily,   what   you   do   is   just   add   some   bmp   images    
  into   a   imagelist,   then   map   each   bmp   image's   keyword   with   a   menuitem's   caption   (same),   it   works   well    
  when   i   use   some   english   menuitem'caption,   but   I   found   this   control   cannot   support   the   chinese   menuitem's    
  caption,   could   you   tell   me   how   to   solve   this   problem?      
  Question   History    
  Comment      
  From:   jrspano     Date:   07/02/2001   06:49AM   PST      
  i   have   a   class   if   you   want   it   that   will   add   icons   to   the   menu   items.   it   uses   api   calls   and   is   number    
  based   and   not   string   based.     I   have   only   tried   it   with   ico   files   though      
  Comment    
  From:   new_fan     Date:   07/02/2001   07:10AM   PST      
  jrspano,could   you   give   me   your   class   and   sample   codes?  
  my   email:   xy_wu@netease.com      
  Comment      
  From:   amit_panjwani     Date:   07/02/2001   10:03AM   PST      
  watching...  
  I   have   code   ...  
  it   works   this   way  
  I   add   picture   boxes  
  specify   pic   source(any   imge   files   I   might   need   )   for   pic   box  
  ...   In   your   context   you   can   use   PRINT   with   Picturebox   and   specify   font   as   well(in   your   case   it   may   be    
  chinese   font   installed   on   your   computer).  
  If   you   need   code   ,   lemme   know  
   
  Amit  
   
     
  Comment      
  From:   jrspano     Date:   07/02/2001   10:20AM   PST      
  i'll   post   it   here   so   any   one   can   see   it.  
  copy   it   into   a   class   module.   add   a   image   list.  
  make   a   new   var   of   the   class   and   then   run.   set   the   image   list   to   use   property   with   your   image   list.   call    
  set   menu   picture   for   each   item   you   want   to   set  
  ex  
  in   ms   stuff   file   is   always   first   is   would   be   postion   0   each   item   under   it   would   be   a   number   starting    
  with   0  
   
   
  SetMenuPicture   0,0,"keyforimagelist"  
  this   would   do   file   new  
  for   file   open   it   would   be   0,1,"key"   etc.  
   
  '   ******************************************************************************  
  '   Routine:                       CMenuWrapper  
  '  
  '   Purpose:   Class   to   provide   menu   functions   not   in   VB  
  '   ******************************************************************************  
   
  Option   Explicit  
   
  'APIs   used   in   class  
  Private   Declare   Function   GetMenu   Lib   "user32"   _  
  (ByVal   hwnd   As   Long)   As   Long  
   
  Private   Declare   Function   GetSubMenu   Lib   "user32"   _  
  (ByVal   hMenu   As   Long,   ByVal   nPos   As   Long)   As   Long  
   
  Private   Declare   Function   GetMenuItemID   Lib   "user32"   _  
  (ByVal   hMenu   As   Long,   ByVal   nPos   As   Long)   As   Long  
   
  Private   Declare   Function   SetMenuItemBitmaps   Lib   "user32"   _  
  (ByVal   hMenu   As   Long,   ByVal   nPosition   As   Long,   ByVal   wFlags   As   _  
  Long,   ByVal   hBitmapUnchecked   As   Long,   ByVal   hBitmapChecked   _  
  As   Long)   As   Long  
  '''''''''''''''  
   
  Private   m_ImageListSet   As   Boolean     'test   to   see   if   image   list   has   been   set  
  Private   m_FormHwnd   As   Long  
  Private   m_MenuHwnd   As   Long  
  Private   m_ImageList   As   ImageList  
   
  Public   Sub   SetMenuPicture(MenuId   As   Long,   MenuSubId   As   Long,   ImageKey   As   Variant)  
        '   ******************************************************************************  
        '   Routine:                       SetMenuPicture  
        '  
        '   Purpose:This   sub   actually   sets   the   picture   for   the   menu   item  
        '  
        '   Input   Variables:MenuId   0   based   item   you   want   to   work   on   menus   go   left   to  
        '                                   right   0   to   whatever  
        '                                   MenuSubId   the   item   in   MenuId   you   want   to   work   on   these  
        '                                   go   top   to   bottom   0   to   whatever   with   separaters   counting  
        '                                   Key   is   the   immage   list   position   id   or   Key  
        '   Output   Variables:None  
        '   ******************************************************************************  
        On   Error   GoTo   hErr  
         
        Dim   lngMenuItemID   As   Long  
        Dim   lngRet   As   Long  
        Dim   lngSubMenuHwnd   As   Long  
   
        'make   sure   vars   have   been   set  
        If   m_FormHwnd   =   0   Then  
                Err.Raise   vbObjectError   +   1000,   "CMenuWrapper",   "FormHwnd   hasn't   been   set!"  
        ElseIf   m_ImageListSet   =   False   Then  
                Err.Raise   vbObjectError   +   1001,   "CMenuWrapper",   "ImageList   hasn't   been   set!"  
        End   If  
   
        'get   the   menu   hwnd   from   the   form   hwnd   passed   in  
        m_MenuHwnd   =   GetMenu(m_FormHwnd)  
         
        'get   the   header   menu   hwnd   that   we   want   to   add   picture   to   from   menuhwnd   and   menu   item   user   passes    
  in  
        lngSubMenuHwnd   =   GetSubMenu(m_MenuHwnd,   MenuId)  
         
        'get   the   actual   hwnd   for   sub   item   user   wants  
        lngMenuItemID   =   GetMenuItemID(lngSubMenuHwnd,   MenuSubId)  
   
        'set   the   picture   for   menu   item  
        lngRet   =   SetMenuItemBitmaps(m_MenuHwnd,   lngMenuItemID,   0,   _  
              m_ImageList.ListImages(ImageKey).Picture,   m_ImageList.ListImages(ImageKey).Picture)  
         
        Exit   Sub  
         
  hErr:  
        Err.Raise   Err.Number,   "CMenuWrapper",   Err.Description  
  End   Sub  
   
  Public   Property   Set   ImageListToUse(data   As   ImageList)  
        '   ******************************************************************************  
        '   Routine:                       ImageListToUse  
        '  
        '   Purpose:Sets   the   image   list   to   use   when   setting   pictures  
        '  
        '   Input   Variables:the   image   list   statments   must   be   in   the   form  
        '                                   Set   DimedVarAsCMenuWrapper   =   imagelist1  
        '  
        '   Output   Variables:None  
        '   ******************************************************************************  
        Set   m_ImageList   =   data  
        m_ImageListSet   =   True  
  End   Property  
   
  'simple   let   and   get   for   form   hwnd   setting/getting  
  Public   Property   Let   FormHwnd(data   As   Long)  
   
        m_FormHwnd   =   data  
   
  End   Property  
   
  Public   Property   Get   FormHwnd()   As   Long  
   
        FormHwnd   =   m_FormHwnd  
   
  End   Property  
   
  Private   Sub   Class_Initialize()  
         
        m_ImageListSet   =   False  
         
  End   Sub  
     
  Top

11 楼thriller(http://vb61.com)回复于 2001-07-04 08:03:24 得分 25

这有什么,我用纯VB代码完全做的到。抓屏助手的菜单怎么样?比它好吧?  
  http://vbaccelerator.com/有这方面的代码下载。  
  不过我可不是用的他的,我自己写的。Top

12 楼thriller(http://vb61.com)回复于 2001-07-04 08:05:59 得分 0

关键是DrawText和TextOut的控制,中文字符在VB5、6里是按一个字节,但他其实是两个字节,也就是说,Len("我们")=2,但DrawText却认为它是4,所以丢了后面的字符。Top

13 楼haitaoyu(咸鱼晾肚皮)回复于 2001-07-04 09:59:21 得分 10

gzTop

14 楼OLD_VB_FAN(蓝星)回复于 2001-07-04 15:34:10 得分 0

本帖暂保留,再加分30,请各位畅谈!!!!!!!!!!!!!Top

15 楼OLD_VB_FAN(蓝星)回复于 2001-07-04 17:53:51 得分 0

各位GO   ON!Top

16 楼OLD_VB_FAN(蓝星)回复于 2001-07-04 19:07:53 得分 0

NEW:  
   
  各位,请参观  
  http://www.csdn.net/expert/topic/181/181778.shtm  
  http://www.csdn.net/expert/topic/181/181764.shtm      
  有经验解决者请援手!!!Top

相关问题

  • 感谢hww02破解这个老外的控件,虽然hww02不好分,还是裸捐200分
  • 100分问题,如何去掉TREE控件里的表MSysAccessStorage,MSysACEs,MSysObjects........,程序是老外写的。
  • 可恶!!!!
  • 控件!!!
  • 控件
  • edit控件
  • 控件
  • 控件
  • 我要像牛群一样裸捐,只要您能破解这个老外的控件,实在是精疲力竭了
  • 比ACTIVEBAR更快捷地创建带图标菜单的控件--->ICONMENU,请CRACK高手行动!

关键词

  • .net
  • vb6
  • win2000
  • 控件
  • 中文
  • 解决
  • 代码
  • 下载
  • im
  • vb

得分解答快速导航

  • 帖主:OLD_VB_FAN
  • iProgram
  • huanggx
  • huanggx
  • huangguanshu
  • joeking
  • thriller
  • haitaoyu

相关链接

  • Visual Basic类图书
  • Visual Basic类源码下载

广告也精彩

反馈

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