|
-
Jul 25th, 2009, 06:52 AM
#1
Thread Starter
Fanatic Member
Numberbox Control
I was wondering if there's some control for a textbox that only accepts numbers.
I know there is the NumericUpDown control but that does't behave in the way I want.
Martin Liss created a control in VB6. See here.
The control only accepts numbers, and has properties such as
CanBeNegative
MaxValue
NinValue
MaxDecimals
Is there a similar control in .NET? And can you create new controls in .NET if one doesn't exist?
-
Jul 25th, 2009, 07:03 AM
#2
Re: Numberbox Control
I'm sure some exist out there, but you can always make your own by creating a custom control that inherits TextBox. Plus, you'll have more control over how YOU want it to behave.
From my burrow, 2 feet under.
-
Jul 25th, 2009, 07:44 AM
#3
-
Jul 25th, 2009, 08:12 AM
#4
Thread Starter
Fanatic Member
Re: Numberbox Control
jmcilhinney,
I've downloaded and installed the component but can't find where to use it.
-
Jul 25th, 2009, 08:15 AM
#5
Re: Numberbox Control
You have to add the controls the library contains (or at least the ones you want to use) to your Toolbox and you use them the same way you use any other controls.
-
Jul 25th, 2009, 08:41 AM
#6
Lively Member
Re: Numberbox Control
Yes, you can create user controls in .NET. I would start by referencing this link from the MSDN website:
http://msdn.microsoft.com/en-us/libr...sc(VS.85).aspx
-
Jul 25th, 2009, 09:22 AM
#7
Re: Numberbox Control
 Originally Posted by Tealmad
A user control and a custom control are not the same thing. What's more, that topic is for ASP.NET, not WinForms.
-
Jul 25th, 2009, 09:41 AM
#8
Lively Member
Re: Numberbox Control
Sorry jmcilhinney. I assumed that is what he was looking for based on the comment of creating a control if one doesn't exist.
-
Jul 25th, 2009, 10:07 AM
#9
Re: Numberbox Control
 Originally Posted by Tealmad
Sorry jmcilhinney. I assumed that is what he was looking for based on the comment of creating a control if one doesn't exist.
Officially, a user control is a control that acts as a container for other controls, while a custom control is one that either inherits Control directly and provides new functionality or else inherits an existing control and provides additional functionality. Of course, a user control inherits an existing control too, i.e. UserControl, but its express purpose is to contain other controls.
-
Jul 25th, 2009, 11:37 AM
#10
Hyperactive Member
Re: Numberbox Control
making a textbox do this is incredibly easy to do in C++, as it is an inherent property of the Win32 Edit control.
For some reason vb.NET decided to not support that, so you will have to make a custom control, or import one that someone else has made
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|