Create Jabaco-Menu / Jabaco-ToolBar
You have to create the Jabaco-Menu in the "Form_Load()"-Routine. You'll find a MenuBar-Property inside the Jabaco-Form. Declare a new VBMenuGroup as parent item. Add a new VBMenuItem with VBMenuGroup-Owner. Similar with Seperator. It is possible to create an icon for each Menu-Item, add a new Image (Gif-,Jpg, Png-File) to the Jabaco-Resource-Manager. Example:
You could handle the Click Event inside the Form with "Form_MenuClick(MenuItem As VB#IMenuItem)".
Similar with the ToolBar:
Handle the Events:
Just try it.
|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 10 |
Public Sub Form_Load() Dim tmpGroupFile As VB#VBMenuGroup = Me.MenuBar.createMenuGroup(Nothing, "File", "File", True, NewPng) Dim tmpMenuNew As VB#VBMenuItem = Me.MenuBar.createMenu(tmpGroupFile, "New", "New") Dim tmpMenuOpen As VB#VBMenuItem = Me.MenuBar.createMenu(tmpGroupFile, "Open", "Open") Dim tmpGroupSubItem As VB#VBMenuGroup = Me.MenuBar.createMenuGroup(tmpGroupFile, "SubItem", "SubItem") Dim tmpGroupSubSubItem As VB#VBMenuGroup = Me.MenuBar.createMenuGroup(tmpGroupSubItem, "SubSubItem", "SubSubItem") Dim tmpGroupSubSubSubItem As VB#VBMenuItem = Me.MenuBar.createMenu(tmpGroupSubSubItem, "SubSubSubItem", "SubSubSubItem") Call Me.MenuBar.AddSeperator(tmpMenuFile) Dim tmpMenuClose As VB#VBMenuItem = Me.MenuBar.createMenu(tmpGroupFile, "Close", "Close") End Sub |
You could handle the Click Event inside the Form with "Form_MenuClick(MenuItem As VB#IMenuItem)".
|
|
Jabaco Source |
1 2 3 |
Public Sub Form_MenuClick(MenuItem As VB#IMenuItem) MsgBox "Caption: " & MenuItem.Caption & " - ControlID: " & MenuItem.ControlID End Sub |
Similar with the ToolBar:
|
|
Jabaco Source |
1 2 3 4 |
Public Sub Form_Load() Call Me.ToolBar.createToolBarItem("New", "New", "ToolTip", NewPng, fmPicturePositionCenter) Call Me.ToolBar.createToolBarItem("Open", "Open", "ToolTip", OpenPng, fmPicturePositionCenter) End Sub |
Handle the Events:
|
|
Jabaco Source |
1 2 3 |
Public Sub Form_ToolBarClick(ToolBarItem As VB#IToolBarItem) MsgBox "ControlID: " & ToolBarItem.ControlID End Sub |
Just try it.
Hi Manuel,
It is very simple and easy
, but how to add a separator line to the ToolBar and how to place a caption bellow ToolBar icon?
Thank you for helping me out!!!
Best regards,
Viktor
It is very simple and easy
Thank you for helping me out!!!
Best regards,
Viktor
I think it will be a good replacement for VB6 after a little improvements and minor bug fixes...
This post has been edited 1 times, last edit by "beic" (Feb 20th 2010, 2:02pm)
I've managed to add a separator:
Hoewever, the separator width and the position parameters don't seem to have any effect (yet).
Another item for the to-do list of the Jabaco framework contributers.
Greetings
A1880
|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Option Explicit Public Sub Form_Load() Call Me.ToolBar.createToolBarItem("New", "New", "ToolTip New", Burning002Png, fmPicturePositionAboveLeft ) Call Me.ToolBar.createToolBarItem("Open", "Open", "ToolTip Open", Burning002Png, fmPicturePositionCenter) Call Me.ToolBar.addSeperator Call Me.ToolBar.createToolBarItem("Tools", "Tools", "ToolTip Tools", Burning002Png, fmPicturePositionCenter) Call Me.ToolBar.addSeperator(5) Call Me.ToolBar.createToolBarItem("Help", "Help", "ToolTip Help", Burning002Png, fmPicturePositionRightCenter) End Sub Public Sub Form_ToolBarClick(ToolBarItem As VB#IToolBarItem) MsgBox "ControlID: " & ToolBarItem.ControlID End Sub |
Hoewever, the separator width and the position parameters don't seem to have any effect (yet).
Another item for the to-do list of the Jabaco framework contributers.
Greetings
A1880
Hi there,
Thank you for quick response, but I did the same thing like in your example code, but no separator(s) was displayed, until I figured out that the problem was in the Windows XP style/theme changes/settings (causing these problems).
So leave the Windows XP default style/theme as is or find out what is wrong with uxtheme patcher!
Thank you again!
Best regards,
Viktor
Thank you for quick response, but I did the same thing like in your example code, but no separator(s) was displayed, until I figured out that the problem was in the Windows XP style/theme changes/settings (causing these problems).
So leave the Windows XP default style/theme as is or find out what is wrong with uxtheme patcher!
Thank you again!
Best regards,
Viktor
I think it will be a good replacement for VB6 after a little improvements and minor bug fixes...
This post has been edited 1 times, last edit by "beic" (Feb 20th 2010, 4:47pm)
Similar threads
-
Tips, Tricks, Samples & Tutorials »-
Using Java-Framework's inside Jabaco
(Aug 22nd 2008, 1:51am)
-
Tips, Tricks, Samples & Tutorials »-
Invoke Methods
(Aug 22nd 2008, 1:04am)
-
Tips, Tricks, Samples & Tutorials »-
Threads and Synchronisation
(Aug 21st 2008, 10:41pm)
