Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7755871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:40:24+00:00 2026-06-01T12:40:24+00:00

I am sure that the answer to this has been posted before. Forgive me

  • 0

I am sure that the answer to this has been posted before. Forgive me as I think I am just not thinking of the right search string.

What I have is a context menu strip assigned to my tray icon for my dialer. The idea is for the user to set various numbers and select the user defined numbers from the menu and initiate the dial.

So the menu pops up with Presets, Setup, & Exit. I want the Presets menu to open a new tree listing the user defined number. I also want this to populate from an xml file every time the application is loaded.

My problem is that I have no idea how to dynamically populate a sub menu item and give it a function.

So how would I at start up add user defined numbers to preset -> (userNumber1, usernumber2, userNumber3) and then call the dial() function when clicked?


So I found how to add to the list… I now feel silly for asking that. For anyone else who wants to know that one, The list item is given a name. Im my case the name attribute is ” presetsToolStripMenuItem”

So to add an item to it call the name

presetsToolStripMenuItem.DropDownItems.Add(string text)

No to move on. I am stuck now trying to figure out how to assign an event to that newly added function. I did find

presetsToolStripMenuItem.DropDownItems.Add(string text, image, eventargs)

I am struggling with this one. Maybe I need to stop and come back to it later. Perhaps if someone could provide me with an example of using this line to call a function(); I would be most appreciative.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:40:26+00:00Added an answer on June 1, 2026 at 12:40 pm

    For anyone that is interested I figured out the solution to adding a context menu item at run time with the ability to call a function.

    As stated before, to add a sub menu item to a a parent category, use the parent.name. So in my case the preset menu item name was “presetsToolStripMenuItem”

    To add function I used the 3 argument method.

     ToolStripMenuItem.DropdownItems.Add("string name", image, eventargs);
    

    so my code looks like this:

    presetsToolStripMenuItem.DropDownItems.Add("added2", null, disp);
    
    void disp(object sender, EventArgs e)
        {
            MessageBox.Show("It works!");
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sure this has been asked, but I have not found the answer. I
I'm sure this question has been answered before, but I can't find an answer
I'm sure this question has been asked before, my apologies for not finding it
I'm sure that this has been asked before, but I don't know what to
I'm sure that this question has been asked before but I've been unable to
I'm pretty sure that this question already has been answered somewhere. It just seems
I'm sorry if this question has been asked before, but I'm not even sure
[I'm not sure if this question has been asked, though I've looked around a
This has been asked before but I can't find a definitive answer, in code.
Do forgive me if this has been asked before, I've been looking for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.