iT邦幫忙

DAY 17
27

VB6之迴光返照系列 第 17

VB6之迴光返照-labelbutton

  • 分享至 

  • xImage
  •  

label也能做出button效果
拉一個label出來放在form上,以下是code
Private Sub Form_Load()
With Label1
.Alignment = 2
.BackColor = RGB(0, 0, 0)
.ForeColor = RGB(255, 255, 255)
.ToolTipText = "我是按鈕"
End With
End Sub

Private Sub Label1_Click()
MsgBox "我是按鈕"
End Sub

Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
With Label1
.BackColor = RGB(0, 0, 255)
.ForeColor = RGB(255, 255, 128)
.BorderStyle = 1
.Caption = ">>>按我<<<"
End With
End Sub

Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
With Label1
.BackColor = RGB(0, 0, 0)
.ForeColor = RGB(255, 255, 255)
.BorderStyle = 0
.Caption = "按我"
End With
End Sub


上一篇
VB6之迴光返照-SQL匯出excel實作
下一篇
VB6之迴光返照- 讀寫ini檔
系列文
VB6之迴光返照30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言