Click here to Skip to main content
15,911,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a user control in C#. It shows up at the top of the toolbox. When I hover over it a balloon displays its name, version and that its a .NET Component. The canned toolbox controls have this and small description. How do I get a description of my user control to show up like the others?
Posted

1 solution

What about his here: Walkthrough: Customizing ToolboxItem Configuration Dynamically[^] and then scroll down to here:

This code snippet was brought to you by courtesy of MSDN:
C#
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace Company.ItemConfigurationCS
{
    // Set the display name and custom bitmap to use for this item.
    // The build action for the bitmap must be "Embedded Resource".
    [DisplayName("ToolboxMember 1 CS")]
    [Description("Custom toolbox item from package ItemConfiguration.")]
    [ToolboxItem(true)]
    [ToolboxBitmap(typeof(Control1), "Control1.bmp")]
    public partial class Control1 : UserControl
    {
        public Control1()
        {
            InitializeComponent();

            button1.Text = this.Name + " Button";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Hello world from " + this.ToString());
        }
    }
}


Using the description attribute on the class itself should do what you want.

Regards,

Manfred
 
Share this answer
 
Comments
David J Perez 2-Feb-12 12:11pm    
I tried this except for the ToolboxBitmap decoration because I don't have a bitmap and it did not work. Seems like it should. It compiled fine but the balloon does not show the Display Name or Description.
Manfred Rudolf Bihy 2-Feb-12 12:38pm    
Too bad! I really thought that would do the trick. :((

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900