Print Page | Close Window

Display menu in code

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=12394
Printed Date: 06 October 2024 at 6:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Display menu in code
Posted By: chrisABC
Subject: Display menu in code
Date Posted: 10 October 2008 at 5:43am
I have a ribbonbar with SystemButton.

When I click the SystemButton, my popdown Menu appears, and remains on screen even if I move the mouse off the menu. This is good.

1.  How can I make the popdown Menu appear like this using code?
     (I have tried  ...ControlSystemButton.execute  and this does make
       the Menu appear, but as soon as I move the mouse off it, the
       Menu disappears)

2.  When I click on a non-valid item on the popdown Menu, the Menu
      disappears.  How can I get it to remain on screen?
      (I have tried  ....ControlSystemButtob.CloseSubMenuOnClick = False
        but this did not affect it).





-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6



Replies:
Posted By: chrisABC
Date Posted: 05 June 2009 at 4:16am
Still no replies to this question.

Is this a really really difficult thing to do?


-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6


Posted By: chrisABC
Date Posted: 30 August 2009 at 4:57am
Originally posted by chrisABC chrisABC wrote:

I have a ribbonbar with SystemButton.

When I click the SystemButton, my popdown Menu appears, and remains on screen even if I move the mouse off the menu. This is good.

1.  How can I make the popdown Menu appear like this using code?
     (I have tried  ...ControlSystemButton.execute  and this does make
       the Menu appear, but as soon as I move the mouse off it, the
       Menu disappears)

2.  When I click on a non-valid item on the popdown Menu, the Menu
      disappears.  How can I get it to remain on screen?
      (I have tried  ....ControlSystemButtob.CloseSubMenuOnClick = False
        but this did not affect it).





I still would like an answer to this.  (End user reminded me that my app is annoying to use because of this :-)


-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6


Posted By: jpbro
Date Posted: 30 August 2009 at 12:00pm
Hi Chris,

I've tried this with 13.1 and the SystemButton menu disappears when the user moves the mouse over other CommandBar controls (e.g. QuickAccess), but not when moved over the non-commandbar portion of the form in both cases that you mention (user click, or code Execute call). Essentially, I see no difference in behaviour between user click and Execute calls.

I also can't see the problem where the menu disappears on "non-valid item" click (although, I'm not sure what a non-valid item is...for my tests, I tried clicking a separator bar drawn via .BeginGroup = True, and the menu did not close).

Here's the sample code I used (CommandBar and CommandButton control on form):


Option Explicit

Private mo_SysBtn As CommandBarControl
Private mo_Rbn As RibbonBar

Private Sub Command1_Click()
   mo_SysBtn.Execute
   ' Also tried mo_Rbn.ControlSystemButton.Execute with no difference in behaviour
End Sub

Private Sub Form_Load()
   With Me.CommandBars1
      .EnableOffice2007Frame True
      .VisualTheme = xtpThemeRibbon
     
      Set mo_Rbn = .AddRibbonBar("Main")
      With mo_Rbn
         .Controls.Add xtpControlButton, 200, "Test"
        
         Set mo_SysBtn = .AddSystemButton
         With mo_SysBtn
            .Id = 1200
            With .CommandBar
               .Controls.Add xtpControlButton, 100, "Test"
               .Controls.Add xtpControlButton, 101, "Test2"
  
               With .Controls.Add(xtpControlButton, 102, "Test3")
                  .BeginGroup = True
               End With
               .Controls.Add xtpControlButton, 103, "Test4"
            End With
         End With
         .EnableFrameTheme
        
     
      End With
     
      .PaintManager.RefreshMetrics
      .RecalcLayout
   End With
End Sub


Can you provide a sample that demonstrates the problems you are experiencing so i can test it?


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: chrisABC
Date Posted: 30 August 2009 at 12:40pm
Thank you for super quick reply.

I have downloaded v13.1.0 and this behaves differently to my previous test.
I think this has solved the problem for me.

BUT it also shows new behaviour (which I do like, but am not sure how or why it is working -- ie. is there a flag to turn on/off this behaviour? Why does it not do this when called from code?).

TEST 1:
Click on the System Button with mouse. Main Menu is displayed.
Move mouse off the menu area-- menu remains displayed.
Move mouse over Quick Access Bar -- menu disappears.
Move mouse back over System Button -- menu reappears <<<<< This is new behaviour.  I like it.

TEST2:
Make Main appear on screen using code  .Execute call.
Move mouse off the menu area -- menu remains displayed.
Move mouse over Quick Access Bar -- menu does not disappear.   ****DIFFERENT TO ABOVE****
Move mouse back over System Button. no change.



So you can see different behaviour if menu displayed with mouse click, compared to if menu displayed in code.
(But my original problem has now been solved.)

I would just like to know if the above difference (ie. menu appears automatically when mouse moved over System Button) can be turned on or off?



-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6



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