Print Page | Close Window

Enable/Disable

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=4843
Printed Date: 20 June 2025 at 5:53pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Enable/Disable
Posted By: moe188
Subject: Enable/Disable
Date 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!



Replies:
Posted By: Oleg
Date Posted: 21 August 2006 at 2:53pm
Hi,
code looks right. What error text you see?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net