![]() |
|
|||||||
| Component Development Development of components with VB.NET |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
I have used NumericUpdown Control in my project, control appears in all most all forms, you may be aware of the fact that minimu and maximum value of numericupdown is 0 and 100 resp by default. Now let me come to the problem i want to override this propert of Numericupdown to set min and max value, my code looks like Public Class NumericControl Inherits NumericUpDown Public Overloads Property Minimum() As String Get Return MyBase.Minimum = 0 End Get Set(ByVal value As String) MyBase.Minimum = value End Set End Property Public Overloads Property Maximum() Get Return MyBase.Maximum = 10000 End Get Set(ByVal value) MyBase.Maximum = value End Set End Property End Class But it doesnt work any suggestion from your side Regards Praveen |
|
|||
|
Hello.
Code:
Return MyBase.Minimum = 0 If you already override the NumericUpDown-Control, use New() to set the desired values. Code:
Public Sub New()
Me.Minimum = 0
Me.Maximum = 1000
End Sub
__________________
Don't give TypeCasting Errors a chance, say ON to Option Strict! Greatest Obfuscator ever: EazFuscator (Freeware) Greatest Reflection Tool ever: .NET Reflector (Freeware) with Add-Ins Greatest Introspection Tool ever: Gendarme (GPL) Greatest MySQL FrontEnd ever: MySQL-Front (Shareware) |
|
|||
|
Public Class NumericUpDowns
Inherits NumericUpDown Public Sub New() InitializeComponent() Me.Minimum = 0 Me.Maximum = 1000 End Sub End Class does this correct syntex Regards Praveen |
|
|||
|
Sounds correct, yes.
The only think you might be aware of, is that it's possible that the Maximum gets still overwritten 'cause it's getting set within the yourForm.Designer.vb. Bobby
__________________
Don't give TypeCasting Errors a chance, say ON to Option Strict! Greatest Obfuscator ever: EazFuscator (Freeware) Greatest Reflection Tool ever: .NET Reflector (Freeware) with Add-Ins Greatest Introspection Tool ever: Gendarme (GPL) Greatest MySQL FrontEnd ever: MySQL-Front (Shareware) |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|