Windows Develop Bookmark and Share   
 index > Windows Forms General > Link 2 inherited custom controls MenuStrip & ToolStripMenuItem - designer
 

Link 2 inherited custom controls MenuStrip & ToolStripMenuItem - designer

i'm trying to create 2 custom controls, once you compile, you have a nice custom control up in the visualstudio I.D.E..
i would like to achieve, the once a dragged 'MenuStrip' onto my form and start adding item, that these items are also a new created costrum control 'cToolStripMenuItem', instead of standart item

without manual changing in the ***.assembler.cs file.

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;

namespace OwnerDraw_Test_3
{
class CMenuStrip : MenuStrip
{
}
class cToolStripMenuItem : ToolStripMenuItem
{
}
}
  • Moved byHarry ZhuMSFTMonday, September 28, 2009 2:59 AMrelating to comtom controls (From:Visual C# General)
  •  
Natural_D  Thursday, September 24, 2009 7:39 PM

Hi,

 

If you want to add a new ToolstripMenuItem to the Menustrip or other class derived from Menustrip dropdownitems in designer, you can add ToolStripItemDesignerAvailability to your class.

    [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.MenuStrip)]

    public class cToolStripMenuItem : ToolStripMenuItem

    {

}

 

ToolStripItemDesignerAvailability Enumeration: http://msdn.microsoft.com/en-us/library/ms161735(VS.85).aspx

 

Best regards,

Ling Wang


Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Friday, October 02, 2009 2:26 PM

Hi,

 

If you want to add a new ToolstripMenuItem to the Menustrip or other class derived from Menustrip dropdownitems in designer, you can add ToolStripItemDesignerAvailability to your class.

    [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.MenuStrip)]

    public class cToolStripMenuItem : ToolStripMenuItem

    {

}

 

ToolStripItemDesignerAvailability Enumeration: http://msdn.microsoft.com/en-us/library/ms161735(VS.85).aspx

 

Best regards,

Ling Wang


Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Friday, October 02, 2009 2:26 PM

You can use google to search for other answers

Custom Search

More Threads

• How to access the controls in a Form in managed C++
• Changing the size of an MDI Parent client area
• HI!!! well is there any way to load a custormise bitmap on a form!!!!!!!!!!how to make its background transparent!!!
• show form without knowing name of form
• DateTimePicker check box event
• raise event
• How to use SetLocaleInfo in C# for change regional settiings of a system using c# code
• send message to other process
• Namespace Best Practices
• Readystate ???