Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - How to Find Control in PopUpBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to Find Control in PopUpBar

 Post Reply Post Reply
Author
Message
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 257
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Topic: How to Find Control in PopUpBar
    Posted: 19 June 2008 at 2:48pm
Using the RibbonBar Sample
there are buttons added to the File popdown menu,  eg.  ID_FILE_MYTEST

How can I "find" these controls on the popdown menu?

     CommandBars.FindControl(, ID_FILE_MYTEST) just gives error.
     so I guess CommandBars is not the correct object to use.





Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
Back to Top
Oleg View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 19 June 2008 at 3:26pm
What error ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 257
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Posted: 19 June 2008 at 5:50pm
Run Time Error 91
Object Variable or With Block variable not set

ALSO:
If I pause program and do:
  For i = 1 to CommandBars(1).Controls.count
     Debug.Print  CommandBars(1).Controls(i).Caption
  Next

This prints out all the buttons on the RibbonBar, but NOT any of the controls on the popdown Menus.

How can I access the controls on the Menus??
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
Back to Top
Oleg View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2008 at 1:30am
Hi,
In FindControl set last parameter to True.
 
 
try this code
Debug.Print  CommandBars(1).Controls(0).CommandBars.Controls(0).Caption
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 257
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2008 at 3:40am
This does not work.

Setting FindControl last paramter = True makes no difference.
CommandBars(1).Controls(0).    does not have property CommandBars


To see the problem, use your Ribbon MDI sample (ActiveX)
Put a Break Point somewhere in  FrmMain (eg. in mnuFileOpen_Click())

When program breaks (eg Click on File Open), go to Immediate Window and try:

   ? CommandBars(1).FindControl(, ID_FILE_MRU_FILE1, False).Caption

I get Error 91, Object not set.
Same error with    ..... (, ID_FILE_MRU_FILE1, True).Caption

But if you try:

    ? CommandBars(1).FindControl(, ID_VIEW_NORMAL, False).Caption

This works OK.


ID_FILE_MRU_FILE1 is ControlButton on PopdownMenu
ID_VIEW_NORMAL is ControlButton on RibbonTab

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Please can you tell me how to FIND  the ID_FILE_MRU_FILE1 control?

Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
Back to Top
Oleg View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2008 at 3:17pm

When you start read my answers :)

In FindControl set last parameter to True.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 257
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2008 at 6:51pm
Oh, you mean the OTHER last parameter :-)

OK, now I see how to make it work.  Thankyou.
(I am not good at crossword puzzles either )


Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.062 seconds.