|
-
April 11th, 2001, 09:57 AM
#1
Menu Items
I am trying to creating on my menu edit the menu item print with subitems which will let the user
pick what he wants to print
This is what i have so far
&Print
...Data1
...Data2
...Data3
However when i click ok onthe menu editor, it is asking me for an index. So where do i put an index number Do i start at 0 or 1 and where do I start from.
Please help.
Thanks
Samantha
-
April 11th, 2001, 10:02 AM
#2
Re: Menu Items
maybe you put the same name for two menu items.
Name the menu items as
mnuPData1
mnuPData2
mnuPData3
Then it will not ask you for the index.
-
April 11th, 2001, 10:24 AM
#3
Re: Menu Items
If you are trying to dynamically create menu items, then you must create one at design time (mnuPrintData) and then assign the Index property a value of 0. Then, at run time you can create news like this:
dim iNextItem as Integer
iNextItem = UBound(mnuPrintData) + 1
Load mnuPrintData(iNextItem)
mnuPrintData(iNextItem).Caption = "print this item"
now, in your Private Sub mnuPrintData_Click() event - you have to check for the value of the Index paramenter that's passed in a do some action accordingly. Like this:
private Sub mnuPrintData(Index as integer)
Select Case Index
Case 1 'they want to print the first item
Call PrintStuff(Index) 'whatever you want to do here...
Case 2 'they want the secod one
'whatever...
Case 3
....
End Select
End Sub
hope this makes sense and/or helps,
john
John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org
John Pirkey
MCSD (VB6)
http://www.stlvbug.org
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|