Print Page | Close Window

HOW to HIDE and ITEM?

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=8312
Printed Date: 21 May 2024 at 10:27am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HOW to HIDE and ITEM?
Posted By: aimcorp
Subject: HOW to HIDE and ITEM?
Date Posted: 05 October 2007 at 8:27am

We’re looking over the entire help file for answers before coming to this forum, also we looked the included samples, however we find the help file very poor on explanations; you click F1 over a command and the help file popped up with the command syntax, but for almost all commands there’s no source code explaining how to use it.

 

Anyway, been two days now that we’re looking the way to hide and unhide an item on a toolbar (ribbonbar) and didn’t find the way to do it from code unless we call it on the MDI form at the beginning.

 

Set ControlPreferences = RibbonBar.Controls.Add(xtpControlPopup, 5, "Preferencias")

With ControlPreferences

   .CommandBar.Controls.Add xtpControlButton, ID_PREF_REA, "Reactivate Warnings"

   .CommandBar.Controls.Add(xtpControlButton, ID_PREF_EDE, "Specialist Data")

   .Flags = xtpFlagRightAlign: .ToolTipText = "": .Width = 80

 End With

 

We want to hide

 

   .CommandBar.Controls.Add xtpControlButton, ID_PREF_REA, "Reactivate Warnings"

 

…from code and probably unhide it later

 

Is there a way to accomplish this?

 

Ariel Maisonet

Aim Corporation




Replies:
Posted By: Oleg
Date Posted: 05 October 2007 at 10:49am
Hello,
 
All our samples have Update handler please check how it works.
 
You need add flag variable that indicates that control need to hide/show and in update handler add
 
Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl)
   
    On Error Resume Next
    Select Case Control.Id
        Case ID_PREF_REA:
               Control.Visible = bControlVisible
     
    End Select
End Sub
...
 
or you can enable actions:
CommandBars.EnableActions
 
and call
CommandBars.Actions(ID_PREF_REA).Visible = False.
...
or jsut use FindControl method, find this control and set its Visible propety to False.
 
 
have no idea what you did 2 days :-)


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


Posted By: aimcorp
Date Posted: 05 October 2007 at 12:10pm
First we appreciate greatly your answer, so what we say here is with good intentions:
 
====================================================
 
CommandBars.Actions(ID_PREF_REA).Visible = False.

 

Not working   return MDIform error

 

or jsut use FindControl method, find this control and set its Visible propety to False.

 

Not working   return MDIform error

 

The solucion is to set the CommandBar PUBLIC!!

 

All your samples showed DIM, we assume DIM will work on the MDI since is there located, but we have to set it Public if we want it to work (we had a hard time to figure it out).

 

Anyway we insist that your help file should be more specific, by giving a simple sample for each command you use on it.

 
Below is what we mean:  Your help file say something like this

Control Property

Description

Gets the collection of controls on the command bar.

Property type

Read-only property

Syntax (Visual Basic)

Public Property Controls() As  mk:@MSITStore:D:\VB6\Xtreme%20SuitePro\Help\SymbolReference.chm::/XtremeCommandBars~CommandBarControls.html - CommandBarControls 

See Also

mk:@MSITStore:D:\VB6\Xtreme%20SuitePro\Help\SymbolReference.chm::/XtremeCommandBars~CommandBar.html - CommandBar Object

 

It ended there, no any single sample for the syntax and how to use it

A short line for example

Set Control = .CommandBar.Controls.Add(xtpControlButton, ID_PREF_DCO, "Deactivate Copy")

Will make the help file more useful
 
Thanks!


Posted By: Oleg
Date Posted: 09 October 2007 at 1:25am
Hello,
CommandBars.Actions(ID_PREF_REA).Visible = False.
have to work.
Think you enabled actions after create controls. Have to call it before you create any control.
See Actions sample.


-------------
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