Print Page | Close Window

ShortCut Bar with Panes

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=602
Printed Date: 23 November 2024 at 7:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ShortCut Bar with Panes
Posted By: bjoeylouie
Subject: ShortCut Bar with Panes
Date 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



Replies:
Posted By: robs
Date 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

 



Posted By: bjoeylouie
Date Posted: 05 April 2004 at 11:17pm
thanks, I'm now getting this error message

"Expected procedure or variable, not module


Posted By: robs
Date 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

 

 



Posted By: bjoeylouie
Date 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



Posted By: robs
Date 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.

 



Posted By: bjoeylouie
Date 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



Posted By: robs
Date 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!

 




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