Context Menu Populate labels - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Context Menu Populate labels

stonesbgstonesbg Posts: 1Member
Hey everyone i want to be able to add a number to a label when they right click on the label they will be given a list of optional numbers. Anyone know how to do this would be greatfull. It is for a sudoku program am developing the user right clicks on a each gridBox(which is a label) then whatever numbers are available to the user will be in this context menu then the user clicks on it and that number will then be populated into the grid hope someone can help out

Comments

  • VanilleBertVanilleBert Posts: 29Member
    : Hey everyone i want to be able to add a number to a label when they right click on the label they will be given a list of optional numbers. Anyone know how to do this would be greatfull. It is for a sudoku program am developing the user right clicks on a each gridBox(which is a label) then whatever numbers are available to the user will be in this context menu then the user clicks on it and that number will then be populated into the grid hope someone can help out
    :

    Hi,

    set the YourLabel.ContextMenuStrip to a ContextMenuStrip containing the possible numbers as Elements. These Elements have a Click event in which you can code YourLabel.Text = XElementX.Text and all should be clear.

    hf with Sudoku,
    Bert
Sign In or Register to comment.