Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all,

Is it possible to change the order of menu item?

 

for example, I have a pop up menu contains

- Get Reports

- Input Student Grade

- Update Student information

 

Now, later on in the code, I will add some menu item depends on some conditions. Say, i will add "Print Reports" to the menu, so normally, it will look like:

- Get Reports

- Input Student Grade

- Update Student information

- Print Reports

 

But instead of this, I will to put the "Print Reports" on top. and it will look like

- Print Reports

- Get Reports

- Input Student Grade

- Update Student information

 

Is it possible to do it this way.

 

P.S. This is a pop up menu, not those menu on top of the bar of the program.

 

Thanks

Carl

Donald DUCK : YOU ARE FIRED!!!
  • Administrators
Posted

One of the overloaded methods of the MenuItems collection allows you to specify a position.

 

Given an already existing context menu you could do

Dim m As New MenuItem("Fred")
ContextMenu1.MenuItems.Add(0, m)

to add a new item to the top of the list.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...