Ribbonbar not dislplaying |
Post Reply |
Author | |
wakerunner
Groupie Joined: 29 September 2007 Status: Offline Points: 85 |
Post Options
Thanks(0)
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.
|
|
Bernie
Senior Member Joined: 05 July 2007 Location: Taiwan Status: Offline Points: 109 |
Post Options
Thanks(0)
|
in the options
set WrapLargePopups
>< possibly
|
|
Bernie Ho, Planning Manager + IELTS specialist + part-time programmer
Taiwan, R.O.C |
|
wakerunner
Groupie Joined: 29 September 2007 Status: Offline Points: 85 |
Post Options
Thanks(0)
|
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 |
|
wakerunner
Groupie Joined: 29 September 2007 Status: Offline Points: 85 |
Post Options
Thanks(0)
|
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 |
|
gaudetm
Senior Member Joined: 23 September 2006 Location: Canada Status: Offline Points: 134 |
Post Options
Thanks(0)
|
what about using the commandbars_update event?
|
|
wakerunner
Groupie Joined: 29 September 2007 Status: Offline Points: 85 |
Post Options
Thanks(0)
|
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.
|
|
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 |