• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2598
  • Last Modified:

Usercontrol's Text property not visible at design (with .Net compact framework)

Hello,
I created a custom control using UserControl class.

I've overriden the Text property but it is not displayed in the porperty window at design time.

Can somebody help me make this property visible ?

Do not forget that I use Compact Framework.

I know that I have to create a XML file DesignTimeAttributes.xmta but don't know how to do it exactly.

Thankx in advance

Greetings

Bulle
0
Bulle
Asked:
Bulle
1 Solution
 
quoclanCommented:
MSDN have many examples about creating user control, example, article named:
- "Creating a Windows Form User Control"
- "Building Windows Forms Controls and Components with Rich Design-Time Features"
....
Hope this help you.
0
 
BulleAuthor Commented:
Thak you quoclan, but these articles do not help me so far, but I've found the solution by myself.

Here it is for Compact Framework and VS 2005 :

Override the Text property (code should be like this one) :

    public override string Text
    {
      get
      {
        return(base.Text);
      }
      set
      {
        base.Text = value;
        this.Invalidate();

      }
    }

The right click on the usercontrol in the solution explorer, choose "View Class Diagram" and then display the class details view for the control.

In this view, you should see the "Text" property, edit the "Custom attributes" of the "Text" property.
And add the 4 lines listed below in the window appearing :
 EditorBrowsable(EditorBrowsableState.Always)
 Browsable(true)
 DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)
 Bindable(true)

Recompile the project ... and you should see teh text property !!!
0
 
GranModCommented:
Closed, 250 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now