Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
My userControl property
Message
From
12/01/2005 10:03:22
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00976394
Message ID:
00976399
Views:
8
This message has been marked as the solution to the initial question of the thread.
Einar,

That's because you havent' actually added a property, you've just made a field member public. To have a property, you need get and set methods:
private bool m_ValidateEachElement;

public bool ValidateEachElement
{
    get {return this.m_ValidateEachElement;}
    set {this.m_ValidateEachElement = value;}
}
~~Bonnie

>I have created a user control (containing 4 textboxes and some labels for IP address entry).
>Everything is working exactly the same way as M$'s IP address entry control, but I want to add my own little property to disable the messagebox warning that appears when the user enters an invalid element of the IP address (i.e. a value not between 0 and 255).
>
>The propperty is added by the following code:
>
>public bool ValidateEachElement;
>
>
>How can I get my property to show up in the list of properties after I add my user control to a form?
>Currently I have to go into the Windows Form Designer generated code section and add the following code:
>
>this.ipTextBox1.ValidateEachElement = true;
>
>
>Thanks,
>Einar
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform