Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - ShortCut Bar with Panes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ShortCut Bar with Panes

 Post Reply Post Reply
Author
Message
bjoeylouie View Drop Down
Newbie
Newbie


Joined: 01 April 2004
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote bjoeylouie Quote  Post ReplyReply Direct Link To This Post Topic: ShortCut Bar with Panes
    Posted: 05 April 2004 at 10:24pm
I have 2 short cut bars on a form named wndLeftShortCutBar and wndMainShortCutBar.  There are several Panes
in the wndLeftShortCutBar as follows:

Sub CreateShortcutBar()
    .
    .
    .     
        
    Set ItemMail = wndLeftShortCutBar.AddItem(1, "Mail", frmPaneMail.hWnd)
    Set Item = wndLeftShortCutBar.AddItem(2, "Calendar", frmPaneCalendar.hWnd)
    Set Item = wndLeftShortCutBar.AddItem(3, "Tasks", frmPaneTasks.hWnd)
    .
    .
    .

frmPaneTasks has several buttons which when clicked will display in wndMainBar.

My question:

How do I display different forms in the wndMainBar by clicking on a button
in wndLeftBar pane?

I tried the following with no luck.

Private Sub btnTasks_Click()
    Dim ItemTasks As IShortcutBarItem
    Load frmTasks
    Set ItemTasks = wndMainBar.AddItem(9, "Tasks", frmTasks.hWnd)
End Sub   

Wonder if you could help me with this?

bJoeyLouie
Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 05 April 2004 at 10:48pm

bjoeylouie,

Is it breaking on Set ItemTaks = wndMainBar.AddItem(9, "Tasks", frmTasks.hWnd) ?

Object Required? If so, try this, of not sorry I couldn't help...

Try adding this to a standard module:

Public mainBar As XtremeSuiteControls.ShortcutBar

Add this to the main form with the shortcutbar:

set mainBar = wndMainBar

Then in btnTasks_clic():

load frmTasks

mainBar.AddItem 9,"Tasks",frmTasks.hWnd

 

Back to Top
bjoeylouie View Drop Down
Newbie
Newbie


Joined: 01 April 2004
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote bjoeylouie Quote  Post ReplyReply Direct Link To This Post Posted: 05 April 2004 at 11:17pm
thanks, I'm now getting this error message

"Expected procedure or variable, not module
Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 05 April 2004 at 11:26pm

In the main form with the shortcutbar:

set mainBar = wndMainShortCutBar instead of set mainBar = wndMainBar

Does this help? If not, what is that error number? Thanks

 

 

Back to Top
bjoeylouie View Drop Down
Newbie
Newbie


Joined: 01 April 2004
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote bjoeylouie Quote  Post ReplyReply Direct Link To This Post Posted: 06 April 2004 at 9:32pm

Still not working, same error message - no error number is provided.  To review what I did:

In the Main Form with the shortcut bar add: 

Set MainBar = wndMainShortcutBar

Add a Module named MainBar.bas  with this code:  

Public MainBar As XtremeSuiteControls.ShortcutBar

Here is the button click event:

Private Sub btnTasks_Click()
    Load frmTasks
    Set ItemMain = wndMainShortcutBar.AddItem(9, "Tasks", frmTasks.hWnd)
End Sub

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 06 April 2004 at 9:38pm

Should be:

Private Sub btnTasks_Click()
    Load frmTasks
    Set ItemMain = MainBar.AddItem(9, "Tasks", frmTasks.hWnd)
End Sub

Sorry if this doesn't work. I was able to get this to work in the ShortcutBar sample by:

1. Adding a button to frmPaneCalendar (this has the btnTasks_click() event)

2. Adding the standard module with the public variable.

3. Setting the public variable in the form_load of frmMain.

 

Back to Top
bjoeylouie View Drop Down
Newbie
Newbie


Joined: 01 April 2004
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote bjoeylouie Quote  Post ReplyReply Direct Link To This Post Posted: 06 April 2004 at 9:57pm

If you have a minute, could you post your code for items 1, 2 and 3 above?  I'd like to duplicate your sample... this will help me find my error.

Thanks

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 07 April 2004 at 8:21pm

Sorry for the delay. Using ShortcutBar Codejock sample, add a form called frmTasks

1. Add the button to frmPaneCalendar named btnTasks

Code:

Private Sub btnTasks_Click()
    Load frmTasks
    Set ItemMain = MainBar.AddItem(9, "Tasks", frmTasks.hWnd)
End Sub

2. Add a standard module with a public variable

Code:

Public MainBar As XtremeSuiteControls.ShortcutBar

3. Set the public variable in the form_load of frmMain

Code:

Set MainBar = wndShortcutBar

 

This works for me. It adds a new item to the collection and when clicked, shows frmTasks.

Good luck!

 

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.141 seconds.