Creating Menus from eVB 
Author Message
 Creating Menus from eVB

Hi all,

quick, probably really simple query.

How does one go about creating menus in eVB - the VB Menu Editor seems to
have disappeared.

Any tutorials or help would be apprieciated!

JC



Tue, 26 Oct 2004 09:40:55 GMT  
 Creating Menus from eVB
Use the MenuBar control.

-Chris


Quote:
> Hi all,

> quick, probably really simple query.

> How does one go about creating menus in eVB - the VB Menu Editor seems to
> have disappeared.

> Any tutorials or help would be apprieciated!

> JC



Wed, 27 Oct 2004 05:34:20 GMT  
 Creating Menus from eVB
Thanks for the overwhelming responses.

Needless to say much ploughing through the help got me to a point where a
menu works, appears and does what any menu should.

Problem.

Too disable a menu option the code

mnuFuncPlay.Enabled = False

should work.

mnuFuncPlay is created via

mnuFunc.Items.Add 1, "mnuFuncPlay", "Play"

however the application returns the following error

Variable is undefined: 'mnuFuncPlay'

does mnuFuncPlay need to be declared as a MenuBarMenu or does mnuFunc.Items
do this for you?

Quote:
> Hi all,

> quick, probably really simple query.

> How does one go about creating menus in eVB - the VB Menu Editor seems to
> have disappeared.

> Any tutorials or help would be apprieciated!

> JC



Fri, 29 Oct 2004 12:28:54 GMT  
 Creating Menus from eVB
Hey Jason,

Using the code sample in the help docs, the following works to disable a
menu item:

Private Sub Form_Load()
    Dim mnuEdit As MenuBarLib.MenuBarMenu

    Set mnuEdit = MenuBar1.Controls.AddMenu("Edit", "mnuEdit")
    mnuEdit.Items.Add 1, "mnuEditSort", "Sort"
    mnuEdit.Items.Add 2, "mnuEditFind", "Find"

    mnuEdit.Items(2).Enabled = False
End Sub

The problem is that you were trying to use the Key parameter of the
Items.Add method as an MenuBarItem object.

hth,
-mike

This posting is provided AS IS with no warranties, and confers no rights.



Sun, 31 Oct 2004 04:06:18 GMT  
 Creating Menus from eVB
yeah - thanks Michael, I did find a tutorial that used that exact code.

It's now working quite well. My menus are following the the buttons.

However, I have seen some menus that can be checked? At a loss as to how to
create them. Any ideas?

JC



Quote:
> Hey Jason,

> Using the code sample in the help docs, the following works to disable a
> menu item:

> Private Sub Form_Load()
>     Dim mnuEdit As MenuBarLib.MenuBarMenu

>     Set mnuEdit = MenuBar1.Controls.AddMenu("Edit", "mnuEdit")
>     mnuEdit.Items.Add 1, "mnuEditSort", "Sort"
>     mnuEdit.Items.Add 2, "mnuEditFind", "Find"

>     mnuEdit.Items(2).Enabled = False
> End Sub

> The problem is that you were trying to use the Key parameter of the
> Items.Add method as an MenuBarItem object.

> hth,
> -mike

> This posting is provided AS IS with no warranties, and confers no rights.



Sun, 31 Oct 2004 08:25:22 GMT  
 Creating Menus from eVB
My book covers Menus thoroughly.  You can download the source code for free
from the Sams web site (don't even have to buy the book) which should get
you well on the way.

-Chris


Quote:
> yeah - thanks Michael, I did find a tutorial that used that exact code.

> It's now working quite well. My menus are following the the buttons.

> However, I have seen some menus that can be checked? At a loss as to how
to
> create them. Any ideas?

> JC



> > Hey Jason,

> > Using the code sample in the help docs, the following works to disable a
> > menu item:

> > Private Sub Form_Load()
> >     Dim mnuEdit As MenuBarLib.MenuBarMenu

> >     Set mnuEdit = MenuBar1.Controls.AddMenu("Edit", "mnuEdit")
> >     mnuEdit.Items.Add 1, "mnuEditSort", "Sort"
> >     mnuEdit.Items.Add 2, "mnuEditFind", "Find"

> >     mnuEdit.Items(2).Enabled = False
> > End Sub

> > The problem is that you were trying to use the Key parameter of the
> > Items.Add method as an MenuBarItem object.

> > hth,
> > -mike

> > This posting is provided AS IS with no warranties, and confers no
rights.



Sun, 31 Oct 2004 23:33:50 GMT  
 Creating Menus from eVB
Hi Chris,
And how do i refer to a menu bar option, from another code module? I wanted
to uncheck a menu bar item, so I tried...

  form1.menubar1.controls.item("K1").checked = false

... but it gives me an error :(
Could someone please help?

Thanks,
Alberto Silva



Quote:
> My book covers Menus thoroughly.  You can download the source code for
free
> from the Sams web site (don't even have to buy the book) which should get
> you well on the way.



Mon, 01 Nov 2004 17:23:32 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Ann: Pocket Menus - Menu code generator for eVB

2. menus - how to create dropdown menus

3. Creating New menu and sub menu items all through code

4. Capturing Menu clicks on Dynamically created Menu

5. Help! Creating menu in the system menu

6. Creating menu item on the right most portion of main menu

7. How create menu items without Menu Editor

8. Help! Using Menu API to create dynamic menus

9. How to create menu without editor menu

10. Buttons to menu bar in eVB

11. Converting from VB6.0 CE Tools to eVB - Instrinsic Menus

12. Menu Bar 3.0 in eVB

 

 
Powered by phpBB® Forum Software