samantha72
April 11th, 2001, 09:57 AM
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
shree
April 11th, 2001, 10:02 AM
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.
Johnny101
April 11th, 2001, 10:24 AM
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