[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2512
  • 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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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