C# Controls - 3 questions
-
Hi there! I've got 3 questions about programming C# controls: 1. How can I bind my own property to one of the categories that are displayed in the Properties window (like 'Behaviour' ora 'Apperance')? Can I make my own cathegory?:confused: 2. I would like the control to know, if it's in a Design mode or in a running app. User has to add all data to my control dynamicly and I want control to display some example while being in Design mode (sth. like TreeView in Win32 API in Resource Editor). How can I implement thing like that?:confused: 3. How can I change the control's icon that is displayed in the Toolbox?:confused: Please! Help me! MP Maciej Pirog
-
Hi there! I've got 3 questions about programming C# controls: 1. How can I bind my own property to one of the categories that are displayed in the Properties window (like 'Behaviour' ora 'Apperance')? Can I make my own cathegory?:confused: 2. I would like the control to know, if it's in a Design mode or in a running app. User has to add all data to my control dynamicly and I want control to display some example while being in Design mode (sth. like TreeView in Win32 API in Resource Editor). How can I implement thing like that?:confused: 3. How can I change the control's icon that is displayed in the Toolbox?:confused: Please! Help me! MP Maciej Pirog
Maciej Pirog wrote: 1. How can I bind my own property to one of the categories that are displayed in the Properties window (like 'Behaviour' ora 'Apperance')? Can I make my own cathegory? Use the 'CategoryAttribute' on one of your control's properties Maciej Pirog wrote: 2. I would like the control to know, if it's in a Design mode Take a look at the Control.DesignMode property Maciej Pirog wrote: How can I change the control's icon that is displayed in the Toolbox? Embed a bitmap in your assembly named the same as your control's fully qualified typename (plus .bmp). So if your control's full name is MyNamespace.MyControl, 'embed as resources' a 16x16 bitmap in your project named 'MyNamespace.MyControl.bmp'. Recompile, and studio should use that bitmap on the toolbox. Check out the code for PropertyTree for an example of embedding Toolbox bitmaps in a control assembly. -- Russell Morris "WOW! Chocolate - half price!" - Homer Simpson, while in the land of chocolate.
-
Maciej Pirog wrote: 1. How can I bind my own property to one of the categories that are displayed in the Properties window (like 'Behaviour' ora 'Apperance')? Can I make my own cathegory? Use the 'CategoryAttribute' on one of your control's properties Maciej Pirog wrote: 2. I would like the control to know, if it's in a Design mode Take a look at the Control.DesignMode property Maciej Pirog wrote: How can I change the control's icon that is displayed in the Toolbox? Embed a bitmap in your assembly named the same as your control's fully qualified typename (plus .bmp). So if your control's full name is MyNamespace.MyControl, 'embed as resources' a 16x16 bitmap in your project named 'MyNamespace.MyControl.bmp'. Recompile, and studio should use that bitmap on the toolbox. Check out the code for PropertyTree for an example of embedding Toolbox bitmaps in a control assembly. -- Russell Morris "WOW! Chocolate - half price!" - Homer Simpson, while in the land of chocolate.
Thanks! Tht's what I needed! :) MP Maciej Pirog