标题:[求助]toolbar问题
取消只看楼主
cq271359502
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-4-29
 问题点数:0 回复次数:3 
[求助]toolbar问题
关于下面这段程序,为什么老执行第一个条件.思路时,当点击Buttons(7)时,检查声音,若有声音,则停止,若无声音,则开启声音

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
    .....
        Case 7
        If 0 < WindowsMediaPlayer1.settings.volume <= 100 Then
        Toolbar1.Buttons(7).Caption = "声音"
        WindowsMediaPlayer1.settings.volume = 0
        Else
        WindowsMediaPlayer1.settings.volume = 100
        Toolbar1.Buttons(7).Caption = "静音"
        End If
end select
end sub

[[italic] 本帖最后由 cq271359502 于 2007-12-27 14:58 编辑 [/italic]]
搜索更多相关主题的帖子: toolbar 
2007-12-27 14:53
cq271359502
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-4-29
得分:0 
哦.发贴是写错了0 < WindowsMediaPlayer1.settings.volume <= 100
2007-12-27 14:58
cq271359502
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-4-29
得分:0 
自己弄了个比较笨的方法,多添加一个按扭,
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
    .....
       Case 7
         WindowsMediaPlayer1.settings.volume = 0
         Toolbar1.Buttons(8).Visible = True     '加载程序时设置该按扭的可见\可控属性均为假
           Toolbar1.Buttons(8).Visible = True   
         Toolbar1.Buttons(7).Visible = False
         Toolbar1.Buttons(7).Enabled = False
        Case 8
         WindowsMediaPlayer1.settings.volume = 100
         Toolbar1.Buttons(8).Visible = False
         Toolbar1.Buttons(8).Enabled = False
         Toolbar1.Buttons(7).Visible = True
         Toolbar1.Buttons(7).Enabled = True
end Select
end sub

[[italic] 本帖最后由 cq271359502 于 2007-12-27 15:31 编辑 [/italic]]
2007-12-27 15:30
cq271359502
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-4-29
得分:0 
谢谢,我以后自己注意下
2008-01-04 21:57



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




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

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