Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Ribbonbar not dislplaying
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbonbar not dislplaying

 Post Reply Post Reply
Author
Message
wakerunner View Drop Down
Groupie
Groupie


Joined: 29 September 2007
Status: Offline
Points: 85
Post Options Post Options   Thanks (0) Thanks(0)   Quote wakerunner Quote  Post ReplyReply Direct Link To This Post Topic: Ribbonbar not dislplaying
    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.
 
 
 
Back to Top
Bernie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 July 2007
Location: Taiwan
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bernie Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
wakerunner View Drop Down
Groupie
Groupie


Joined: 29 September 2007
Status: Offline
Points: 85
Post Options Post Options   Thanks (0) Thanks(0)   Quote wakerunner Quote  Post ReplyReply Direct Link To This Post 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
   
Back to Top
wakerunner View Drop Down
Groupie
Groupie


Joined: 29 September 2007
Status: Offline
Points: 85
Post Options Post Options   Thanks (0) Thanks(0)   Quote wakerunner Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
gaudetm View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 September 2006
Location: Canada
Status: Offline
Points: 134
Post Options Post Options   Thanks (0) Thanks(0)   Quote gaudetm Quote  Post ReplyReply Direct Link To This Post Posted: 27 December 2007 at 5:56pm
what about using the commandbars_update event?
Back to Top
wakerunner View Drop Down
Groupie
Groupie


Joined: 29 September 2007
Status: Offline
Points: 85
Post Options Post Options   Thanks (0) Thanks(0)   Quote wakerunner Quote  Post ReplyReply Direct Link To This Post 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.
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.125 seconds.