none
chechedlistbox in contextmenustrip RRS feed

  • Question

  • Hi

    As you see in the subject i need to use CheckedListBox in Right click menu and don't know how to make it.

    is there any suggestions?

    here the sample that i need that.


    N.N

    Sunday, May 27, 2012 9:18 AM

Answers

All replies

  • No i didnot mean that way. I know how to set the contextmenu property of an object to the created ContextMenustip object.

    I want to create an other object in ContextMenuStrip1. do you get me?

    as you know we can only create TextBox and ComboBox in a ContextMenu Object. please pay attention to the Subject. I want to create CheckedListbox in a ContextMenuStrip1.

    I also Attached a Picture of my request that shows the project.


    N.N

    Sunday, May 27, 2012 9:43 AM
  • I believe what you are trying ot do is similar to creating a custom column in a DataGridView.  Normally a Data gridview will only use eith Text columns or Combboxes.  But you can also add a cutome object to the column.  so I did a search of "DataGridView custom column" and found a lot of the webpage below may help[

    http://blogs.msdn.com/b/msdnts/archive/2007/01/19/how-to-bind-a-datagridview-column-to-a-second-level-property-of-a-data-source.aspx

    In th ecode look especially at these tow functions

    1) public class StudentContactTypeDescriptionProvider : TypeDescriptionProvider


    2) public class StudentContactCCTypeDescriptor : CustomTypeDescriptor


    jdweng

    Sunday, May 27, 2012 11:47 AM
  • no it was not my answer too.

    First of all i should appreciate your answer about working with DataGridView and Customizing its columns.

    But My Friends I want to Customize the items of ContextMenuStrip Component. yes I know what i am saying because Microsoft has done it before then we can too.


    N.N

    Sunday, May 27, 2012 12:38 PM
  • The principle is the same with the ContextMenuStrip and with a DataGridView column.

    Look at the sample code on this webpage

    http://msdn.microsoft.com/en-us/library/22c1dx6k

    The code uses statement like this

    contextMenu1.MenuItems.Add(menuItem3);

    menuItem3 can be any type object.  You need to create a class for you custom contextMenu1 and then add your new class as a menu item. 

    public class contextMenuCheck box Mycheckbox : Checkbox

    {

    }

    Sample code

    C#

    http://code.msdn.microsoft.com/CSCustomIEContextMenu-f784ff82

    VB.net

    http://code.msdn.microsoft.com/VBCustomIEContextMenu-ec5c0d2c


    jdweng

    • Marked as answer by navidsoft Sunday, May 27, 2012 3:49 PM
    Sunday, May 27, 2012 1:23 PM