Visual Basic .NET Forums  

Go Back   Visual Basic .NET Forums > VB.NET > Component Development

Component Development Development of components with VB.NET

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-07-2009, 6:18 AM
VB.NET Forum Enthusiast
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Sep 2005
Location: Mumbai
Age: 29
Posts: 70
Reputation: 50
prav_roy is on a distinguished programming path ahead
Default Override Controls Property

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-07-2009, 7:22 AM
VB.NET Forum Master
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jun 2008
Location: Vienna, Austria
Age: 22
Posts: 337
Reputation: 275
Robert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NET
Default

Hello.

Code:
Return MyBase.Minimum = 0
This is nonsense! If this would return something than it's a boolean!
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
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-07-2009, 7:57 AM
VB.NET Forum Enthusiast
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Sep 2005
Location: Mumbai
Age: 29
Posts: 70
Reputation: 50
prav_roy is on a distinguished programming path ahead
Default hi again

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-08-2009, 2:58 AM
VB.NET Forum Master
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jun 2008
Location: Vienna, Austria
Age: 22
Posts: 337
Reputation: 275
Robert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NET
Default

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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 5:10 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0


For advertising opportunities click here.