VB按键美观问题
按键显示效果
按键按下效果
请教一下,如何把按键的边框去掉,只显示里面的图片,这样好看一点。注明一下是要做按键,谢谢!
[ 本帖最后由 chenbiao2011 于 2011-6-25 22:51 编辑 ]
Option Explicit Dim ButtonStatus() As Boolean '按钮图片状态用 Private Sub Form_Initialize() ReDim ButtonStatus(3) End Sub Private Sub Form_Load() Dim i As Integer With Form1 .Top = 0 .Left = 0 .Height = "背景图高" .Width = "背景图宽" .Picture = LoadPicture("背景图路径") End With For i = 0 To UBound(ButtonStatus) ButtonStatus(i) = False '按钮图片状态初始化 Next i End Sub Private Sub Image1_Click(Index As Integer) Select Case Index Case 0 If ButtonStatus(0) = True Then Image1(0).Picture = ImageList1.ListImages(0).Picture ButtonStatus(0) = False Call AAA '按下按钮0触发的事件内容 Else Image1(0).Picture = ImageList2.ListImages(0).Picture ButtonStatus(0) = True Call BBB '按下按钮0触发的事件内容 End If Case 1 If ButtonStatus(1) = True Then Image1(0).Picture = ImageList1.ListImages(1).Picture ButtonStatus(1) = False Call CCC '按下按钮1触发的事件内容 Else Image1(0).Picture = ImageList2.ListImages(1).Picture ButtonStatus(1) = True Call DDD '按下按钮1触发的事件内容 End If Case 2 If ButtonStatus(2) = True Then Image1(0).Picture = ImageList1.ListImages(2).Picture ButtonStatus(2) = False Call EEE '按下按钮2触发的事件内容 Else Image1(0).Picture = ImageList2.ListImages(2).Picture ButtonStatus(2) = True Call FFF '按下按钮2触发的事件内容 End If Case 3 If ButtonStatus(3) = True Then Image1(0).Picture = ImageList1.ListImages(3).Picture ButtonStatus(3) = False Call GGG '按下按钮3触发的事件内容 Else Image1(0).Picture = ImageList2.ListImages(3).Picture ButtonStatus(3) = True Call HHH '按下按钮3触发的事件内容 End If End Select End Sub