Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6873099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:00:53+00:00 2026-05-27T04:00:53+00:00

I would like to use a class that ProvideProperty as object inside the disigner

  • 0

I would like to use a class that ProvideProperty as object inside the disigner but it seems I can’t use it when the property is an Object. A string works well.

I can set and get within the code but not in the designer.

Big thx

My code :

Imports System.Windows.Forms
Imports System.ComponentModel

<ProvideProperty("Champ", GetType(Control))> _
<ProvideProperty("Valeur", GetType(Control))> _
<ProvideProperty("Comparaison", GetType(Control))> _
Public Class ProprietesEtendues
    Implements IExtenderProvider

    Public Enum CompareType
        Egal
        Different
        PlusGrand
        PlusGrandEgal
        PlusPetit
        PlusPetitEgal
    End Enum

    Private _champ As New Dictionary(Of IntPtr, String)
    Private _val As New Dictionary(Of IntPtr, Object)
    Private _comp As New Dictionary(Of IntPtr, CompareType)

    'Propriété Comparaison
    Public Function GetChamp(ByVal c As Control) As String
        Dim strRetour As String = ""
        _champ.TryGetValue(c.Handle, strRetour)
        Return strRetour
    End Function

    <DefaultValue(""), Category("Data"), Description("Ajoute une propriété de type String")> _
    Public Sub SetChamp(ByVal c As Control, ByVal value As String)
        _champ(c.Handle) = value
    End Sub

    'Propriété Valeur
    Public Function GetValeur(ByVal c As Control) As Object
        Dim objRetour As Object = ""
        _val.TryGetValue(c.Handle, objRetour)
        Return objRetour
    End Function

    <DefaultValue(""), Category("Data"), Description("Ajoute une propriété de type Object")> _
    Public Sub SetValeur(ByVal c As Control, ByVal value As Object)
        _val(c.Handle) = value
    End Sub

    'Propriété Comparaison
    Public Function GetComparaison(ByVal c As Control) As CompareType
        Dim ctRetour As CompareType = CompareType.Egal
        _comp.TryGetValue(c.Handle, ctRetour)
        Return ctRetour
    End Function

    <DefaultValue(CompareType.Egal), Category("Data"), Description("Ajoute une propriété de type CompareType")> _
    Public Sub SetComparaison(ByVal c As Control, ByVal value As CompareType)
        _comp(c.Handle) = value
    End Sub

    Public Function CanExtend(ByVal target As [Object]) As Boolean Implements IExtenderProvider.CanExtend
        Return True
    End Function
End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:00:54+00:00Added an answer on May 27, 2026 at 4:00 am

    Normaly, you can put at least a string like the Tag property

    If a string is good enough then you can apply the [TypeConverter] attribute:

    <TypeConverter(GetType(StringConverter))> _
    Public Function GetValeur(ByVal c As Control) As Object
        Dim objRetour As Object = ""
        _val.TryGetValue(c.Handle, objRetour)
        Return objRetour
    End Function
    
    <DefaultValue(""), Category("Data"), Description("Ajoute une propriété de type Object")> _
    <TypeConverter(GetType(StringConverter))> _
    Public Sub SetValeur(ByVal c As Control, ByVal value As Object)
        _val(c.Handle) = value
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that I would like to use in a scala.collection.mutable.PriorityQueue, but
Can I use getCacheDir() only in a class that extends Activity? I would like
I would like to create a Javascript class that I can use like so:
I would like to use a Swing Timer , in a Java class that
I would like to use it-the AccountController class that is created by default when
I have a configuration class that I would like to use for a variety
I have created an ASP.NET class. In that class i would like to use
I would like to use different instances of an STL custom allocator class to
I have an abstract class and I would like to use it quickly by
I would like to ask couple of Questions regarding the use of Monitor Class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.