熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> PB編程 >> 正文

PowerBuilder制作IE風格的圖標按鈕[2]

2022-06-13   來源: PB編程 
    定義控件實例變量 
    
    // Declare Instance Variables
    
    Private:
    boolean ib_MouseCaptured

    Public:
    string is_PicNormal
    string is_PicDisabled
    string is_PicMouseOver
    string is_PicClickDown
    int in_State
      
      定義用戶事件
    
    // Declare User Events
    
    Event Name=mousemove ID=pbm_mousemove
    Event Name=lbuttondown ID=pbm_lbuttondown
    Event Name=lbuttonup ID=pbm_lbuttonup
    
      編寫事件代碼

    // Constructor 事件代碼
    // *** begin constructor event ***
    //
    is_PicNormal = thisPictureName
    is_PicDisabled = Disabled狀態圖片bmp
    is_PicMouseOver = MouseOver狀態圖片bmp
    is_PicClickDown = ClickDown狀態圖片bmp
    in_State =

    sb_SuppressHoverBorder = FALSE
    //
    // *** end constructor event ***

    // MouseMove 事件代碼
    // *** begin mousemove event ***
    //
    rect lr_Border

    if not ib_MouseCaptured then 
      if flags < > then 
        thisPictureName = is_PicMouseOver 
      else 
        // Left Button Down
        thisPictureName = is_PicClickDown 
      end if 
      in_State =

      SetCapture(handle(this)) 
      ib_MouseCaptured = TRUE

[]  []  []  []  


From:http://tw.wingwit.com/Article/program/PB/201311/24552.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.