Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - enable/disable entire command bar?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

enable/disable entire command bar?

 Post Reply Post Reply
Author
Message
DanielWilson View Drop Down
Newbie
Newbie


Joined: 11 September 2007
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote DanielWilson Quote  Post ReplyReply Direct Link To This Post Topic: enable/disable entire command bar?
    Posted: 14 July 2009 at 5:29pm
Is there a way to disable then re-enable the entire command bar?

I have a customer using 11.2 and they have a long-running Save routine. If you click Save, then click several command buttons, the whole app crashes.  Sometimes only 1 button click is needed.

I believe that if I can prevent the user from clicking another button until that Save is complete, I can stop the crashes.  At least, I want to test that hypothesis.

So ... can I disable the command bar?

Thanks!
Daniel Wilson
Software Craftsman in Northern Indiana
http://BlackLocustSoftware.com
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: 15 July 2009 at 1:36am
Hi,
 
Guess you can just add some varaible that Save process is running and exit from Execute event if so.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Mr.Den View Drop Down
Groupie
Groupie
Avatar

Joined: 26 August 2007
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mr.Den Quote  Post ReplyReply Direct Link To This Post Posted: 15 July 2009 at 11:56am
This is how I set the command bar controls to disabled:
 
Dim obBar As CommandBar
Dim obCtrl As CommandBarControl

Dim iLCtr As Integer

On Error GoTo errHandler
   
    Set obBar = CommandBars.item(2)
   
    If bMActive = True Then
                
        For iLCtr = 1 To obBar.Controls.count
           
            Set obCtrl = obBar.Controls.item(iLCtr)
           
            If obCtrl.Id <> ID_CTRL_PLAY Then
                If obCtrl.Id <> 1000 Then
                    obCtrl.Enabled = True
                End If                
            End If
           
        Next iLCtr
       
    Else
                
        For iLCtr = 1 To obBar.Controls.count
           
            Set obCtrl = obBar.Controls.item(iLCtr)
           
            If obCtrl.Id <> ID_CTRL_STOP Then
                If obCtrl.Id <> ID_CTRL_PAUSE Then
                    If obCtrl.Id <> ID_CTRL_ONTOP Then
                        obCtrl.Enabled = False
                    End If
                End If
            End If
           
        Next iLCtr
       
    End If

errHandler:
   
    If Err.Number Then
        MsgBox Err.Number & ",  " & Err.Description, vbCritical, "SetActive"
    End If

 
Edit:
 
Had to leave aburuptly , so here goes:
 
Pass a boolean value to a sub, or as I did, I used bMActive as a modular level variable.
 
Use a for/next loop to iterate through the controls on the commandbar, and set the Enabled property as needed, depending on the Id if desired.
 
Product: Xtreme SuitePro (ActiveX) version 16.3.1

Platform: Windows 7 Professional (64bit) - SP 1

Language: Visual Basic 6.0 SP 6
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.156 seconds.