![]() |
HOW to HIDE and ITEM? |
Post Reply ![]() |
Author | |
aimcorp ![]() Groupie ![]() Joined: 20 September 2007 Location: Puerto Rico Status: Offline Points: 21 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
aimcorp ![]() Groupie ![]() Joined: 20 September 2007 Location: Puerto Rico Status: Offline Points: 21 |
![]() ![]() ![]() ![]() ![]() |
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 PropertyDescription
Gets the collection of controls on the command bar. Property type
Read-only property Syntax (Visual Basic)Public Property Controls() As CommandBarControls See Also
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!
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
CommandBars.Actions(ID_PREF_REA).Visible = False.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |