mcerk Posted January 16, 2005 Posted January 16, 2005 Hi. I created Min and Max property in my custom control. I'd like them to have default values. How can I do it? Public Property Max() As Long Get Max = _Max End Get Set(ByVal Value As Long) _Max = Value End Set End Property Quote
Administrators PlausiblyDamp Posted January 16, 2005 Administrators Posted January 16, 2005 Easiest way is to assign a value to _Min and _Max within the control's Sub New Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
mcerk Posted January 16, 2005 Author Posted January 16, 2005 I tried this, but it doesn't worlk. The values are still 0. Quote
*Experts* mutant Posted January 16, 2005 *Experts* Posted January 16, 2005 Can you show excatly how you tried? Quote
mcerk Posted January 16, 2005 Author Posted January 16, 2005 (edited) ok, I did it right now and it works perfectly tx Edited January 16, 2005 by mcerk Quote
Wraith Posted January 17, 2005 Posted January 17, 2005 Or theres the DefaultValueAttribute if you're working with the componantmodel, which you are if its a form/control and you're not if its a standard class. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.