标题:看一看这段程序哪里错了
取消只看楼主
shuangziputi
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-4-28
 问题点数:0 回复次数:0 
看一看这段程序哪里错了

private Sub Form_Load()
Dim Count As Integer
Dim LblBtn() As String
For Count = 0 To 3 '请将此出的3换成你的LblBtn数量的个数-1
LblBtn(Count).BackColor = LBL_BACK_COLOR '初始化LblBtn的背景
Next Count
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Count As Integer
DoEvents
For Count = 0 To 3
LblBtn(Count).BackColor = LBL_BACKCOLOR '恢复背景
Next Count
End Sub

Private Sub LblBtn_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
LblBtn(Index).BackColor = LBL_WHEN_MOUSE_DOWN '临时改变LblBtn背景颜色
End Sub
Private Sub LblBtn_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Count As Integer
DoEvents '暂时将系统控制权教给系统
If Button Then Exit Sub '如果按钮被按下就退出该过程
For Count = 0 To 3
If Count <> Index Then '如果按下的不是其它按钮
LblBtn(Index).BackColor = LBL_BACK_COLOR '将背景设为正常
Else
LblBtn(Index).BackColor = LBL_WHEN_MOUSE_MOVE '将背景设为鼠标移动的背景
End If
Next Count
End Sub

Private Const LBL_BACK_COLOR = &HE0E0E0 '正常时Label控件的背景色
Private Const LBL_WHEN_MOUSE_MOVE = &HC0C0C0 '鼠标移动时Label的背景色
Private Const LBL_WHEN_MOUSE_DOWN = &H808080 '鼠标按下时Label的背景色

[此贴子已经被作者于2007-4-29 22:21:47编辑过]

搜索更多相关主题的帖子: 背景 private 
2007-04-29 22:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-136088-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.829260 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved