Make a component appear on the form at design time
-
I'm trying to make a component who's function can best be described as similar to the MainMenu component in VS.NET. The component should be able to add controls to the parent form at design time. Via code in the component, I can create the new control and add it to the same container as the component, thus making it visible in the properties window of the form (via the combobox in the properties window), but I can't seem to figure out how to make the control visible on the form. How can this be done?
-
I'm trying to make a component who's function can best be described as similar to the MainMenu component in VS.NET. The component should be able to add controls to the parent form at design time. Via code in the component, I can create the new control and add it to the same container as the component, thus making it visible in the properties window of the form (via the combobox in the properties window), but I can't seem to figure out how to make the control visible on the form. How can this be done?
If your component is a UserControl then you should have no problem seeing it on the form when you drop it from the toolbox. It acts as any other .NET built-in component. The component should be in a seperate project and should be a UserControl type.
-
If your component is a UserControl then you should have no problem seeing it on the form when you drop it from the toolbox. It acts as any other .NET built-in component. The component should be in a seperate project and should be a UserControl type.
The UserControl does not look the same as the MainMenu. As for the MainMenu the main component is the one that sits in the yellow field below the actual form. From that, several controls on the form are created, one for every MenuItem. I want to make a component (inherit from System.ComponentModel.Component) and by using code in the component I want to create several controls on the actual form at design time. Just like the MainMenu or the toolbar of VS 2005. The reason for this is that I want to manage several controls from one location, the component.