Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am making a control and have a couple of different options for it in the properties. This all works, but I am trying to find out how to make a certain option appear under a certain tab, eg Appearance, Bahaviour etc. I can only seem to get it to appear in the Misc tab.

 

Thanks

 

Steve

Posted

try this:

 

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

public class MyUserControl:Control
{
   [b][Category("Appearance")][/b]
   public Color myColorProperty
   {
       get{return base.ForeColor;}
       set{base.ForeColor = value;}
   }
}

Imports System
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms

Public Class MyUserConrol
  Inherits Control

   [b]<Category("Appearance")> _[/b]
   Public Property myColorProperty() As Color
       Get
           Return MyBase.ForeColor
       End Get
       Set(ByVal Value As Color)
           MyBase.ForeColor = Value
       End Set
   End Property
End Class

 

Hope this helps!

 

Andreas

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...