Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Enable/Disable
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Enable/Disable

 Post Reply Post Reply
Author
Message
moe188 View Drop Down
Senior Member
Senior Member


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Topic: Enable/Disable
    Posted: 21 August 2006 at 2:22pm
Hi,
I am trying to enable a button at run-time erroe but for some reason I can not get it to work and I am recieving a error message:
 
 
My code:
 
Set ControlFile = MenuBar.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&File")
 With ControlFile.CommandBar.Controls
        .Add xtpControlButton, FILE_NEW, "&New"
        .Add xtpControlButton, FILE_OPEN, "&Open"
        Set Control = .Add(xtpControlButton, FILE_SAVE, "&Save"):  Control.BeginGroup = True: Control.Enabled = False
        Set Control = .Add(xtpControlButton, FILE_PRINT, "&Print"): Control.Enabled = False
        Set Control = .Add(xtpControlButton, FILE_EXIT, "&Exit"): Control.BeginGroup = True
End With
 
and within the commandbar_update
select case control.id
case FILE_PRINT: if PName="" then control.enable=false else control.enable=true
end select
 
 
Please Help!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2006 at 2:53pm
Hi,
code looks right. What error text you see?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.