资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

我想把一个按钮传进去该怎么写?

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

我想把一个按钮传进去该怎么写?比如把command1传进去.  
   
  public   sub   Button_Color()  
   
  txtSQL   =   "select   *   from   office_building_state   where   building_id=102"  
  Set   mrc   =   ExecuteSQL(txtSQL,   MsgText)  
   
  If   mrc.EOF   =   False   Then  
  building_start   =   mrc.Fields(3)  
  If   building_start   =   1   Then  
        Room102.BackColor   =   &HFF&  
  Else  
      If   building_start   =   2   Then  
            Room102.BackColor   =   &HFF00FF  
     
  Else  
          If   building_start   =   3   Then  
                Room102.BackColor   =   &HFF00&  
          End   If  
      End   If  
  End   If  
  End   If  
  mrc.MoveNext  
   
  mrc.Close  
   
  end   sub  
 

网友回答:

发表者:qiqi5521

hhjjhjhj(大头)(想变胡萝卜^^)   的方法是对的  
  至于真么调用,  
  假如按钮控件的名字是   cmd1  
  这样调用  
  Button_Color     cmd1  
  或  
  call   Button_Color(cmd1)  
   
 

发表者:zdcwin

楼主的意思是不是将COMMAND1的某项属性传过去啊?  
  另外,提一个建议:  
  楼主的这段代码  
  building_start   =   mrc.Fields(3)  
  If   building_start   =   1   Then  
        Room102.BackColor   =   &HFF&  
  Else  
      If   building_start   =   2   Then  
            Room102.BackColor   =   &HFF00FF  
     
  Else  
          If   building_start   =   3   Then  
                Room102.BackColor   =   &HFF00&  
          End   If  
      End   If  
  End   If  
  改用SELECT   CASE   语句会更好一些!


 

 
热门推荐笔记本: 海尔笔记本
相关文章:
笔记本相关:
IT技术文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved