Print Page | Close Window

Ribbonbar not dislplaying

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=9168
Printed Date: 08 October 2024 at 10:49am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Ribbonbar not dislplaying
Posted By: wakerunner
Subject: Ribbonbar not dislplaying
Date Posted: 22 December 2007 at 2:45am
I have code to create a ribbon bar on a MDI parent form, I used the same code in 2 different projects and am getting different results. In one when the width of the form is too small for all the buttons to fit the entire group dissapears, on the other the group turns into a dropdown that can be clicked on to display the buttons. I can't figure out why the difference.
 
What am I missing? What could change this behavior? I am attaching a image so you can see what I mean, the image is the one where the group becomes a dropdown, I want this same behavior on both projects.
 
 
 



Replies:
Posted By: Bernie
Date Posted: 22 December 2007 at 3:13am
in the options
 
set WrapLargePopups
 
>< possibly


-------------
Bernie Ho, Planning Manager + IELTS specialist + part-time programmer
Taiwan, R.O.C


Posted By: wakerunner
Date Posted: 22 December 2007 at 11:23am
Thanks for the reply, but that does not change the behaviour. I found out the difference in my code, why it behaves one way in one project and not the other.
 
In the project where the groups dissapear instead of turning into a dropdown I have code in the form resize event of the MDI child that sets some of the buttons on the ribbon to visible=false, if I skip this code it behaves the way I want. Only problem is I have to be able to set some of the buttons to be not visible as I load or unload different forms. Does anybody know how to implement this? I tried the all of the below with no luck.
 
ribbonbar.RecalcLayout
ribbonbar.RedrawBar
CommandBars.Options.WrapLargePopups = True
   


Posted By: wakerunner
Date Posted: 22 December 2007 at 11:40pm
Found the fix, don't know why this fixes the problem but it does. I'll post it here in case it can help somebody else with the same problem.
 
Below is the code I was using to loop through the buttons and make the desired buttons visible and others not visible.
 
 
For a% = 1 To main1.CommandBars.ActiveMenuBar.Controls.Count
Select Case main1.CommandBars.ActiveMenuBar.Controls(a%).id
Case 1, 2, 3, 4, 5, 17, 21
main1.CommandBars.ActiveMenuBar.Controls(a%).visible=true'***
Case Else
main1.CommandBars.ActiveMenuBar.Controls(a%).visible=false'***
End Select
Next a%
 
I replaced the lines above with *** with the line below and it fixed the problem.
 
main1.CommandBars.FindControl(,main1.CommandBars.ActiveMenuBar.Controls(a%).id).Visible = True

or

 
main1.CommandBars.FindControl(,main1.CommandBars.ActiveMenuBar.Controls(a%).id).Visible = False



Posted By: gaudetm
Date Posted: 27 December 2007 at 5:56pm
what about using the commandbars_update event?


Posted By: wakerunner
Date Posted: 27 December 2007 at 6:02pm
I ffixed the problem by replacing the code below:
 
CommandBars.ActiveMenuBar.Controls(a%).visible=true
 
With the line below
 
CommandBars.FindControl(,CommandBars.ActiveMenuBar.Controls(a%).id).Visible = True
 
 
Don't know why it makes a difference, but it works.



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