NB封装的Button按钮类

 

#定义 IDD_DLG1                1000
#定义 IDC_BTN1                1001
#定义 IDC_BTN2                1002
#定义 IDC_BTN3                1003

 

子程序 X_SetFocus (hWnd 为 HWND)
  SetFocus (hWnd)
结束 子程序

 

类型 kj_Button
  变量 hWnd 为 HANDLE
  声明 子程序 Init (传值 WinHWND 为 HANDLE, 传值 WinID 为 DWord)
   声明 子程序 Click ()
  声明 子程序 Refresh ()
  声明 子程序 SetFocus ()
  声明 子程序 Move (传值 X 为 DWORD , 传值 Y 为 DWORD , 传值 WWidth 为 DWORD , 传值 Height 为 DWORD)
  声明 属性 Enabled (NewBol 为 BOOL)     '属性 : 是否 可用
  声明 属性 Enabled 为 BOOL
  声明 属性 Visible (NewBol 为 BOOL)        '属性 : 是否 可见
  声明 属性 Visible 为 BOOL
  声明 属性 Caption (NewStr 为 文本)         '属性 : 标题
  声明 属性 Caption 为 文本
结束 类型

子程序 kj_Button.Init (传值 WinHWND 为 HANDLE , 传值 WinID 为 DWord)
  如果 WinID = 0 则
   hWnd = WinHWND
  否则
   hWnd = GetDlgItem( WinHWND , WinID)
  结束 如果
结束 子程序

子程序 kj_Button.Click ()
  SendMessage (hWnd , BM_CLICK , 0 , 0)
结束 子程序

子程序 kj_Button.Refresh ()
  UpdateWindow (hWnd)
结束 子程序

子程序 kj_Button.SetFocus ()
  X_SetFocus (hWnd)
结束 子程序

子程序 kj_Button.Move (传值 X 为 DWORD , 传值 Y 为 DWORD , 传值 W 为 DWORD , 传值 H 为 DWORD)
  MoveWindow (hWnd , X , Y , W , H , TRUE)
结束 子程序

属性 kj_Button.Enabled (NewBol 为 BOOL)
  EnableWindow (hWnd , NewBol)
结束 属性

属性 kj_Button.Enabled 为 BOOL
  Enabled = IsWindowEnabled (hWnd)
结束 属性

属性 kj_Button.Visible (NewBol 为 BOOL)
  ShowWindow (hWnd , 选择 (NewBol , SW_SHOW , SW_HIDE))
结束 属性

属性 kj_Button.Visible 为 BOOL
  Visible = IsWindowVisible (hWnd)
结束 属性

属性 kj_Button.Caption (NewStr 为 文本)
  SetWindowText (hWnd , NewStr)
结束 属性

属性 kj_Button.Caption 为 文本
  变量 TL 为 DWORD , TS 为 文本
  TL = GetWindowTextLength (hWnd)
  TS = 取空白文本 (TL)
  GetWindowText (hWnd , TS , TL + 1)
  Caption = TS
结束 属性

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值