473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to access up down buttons in a NumericUpDown

(this was posted on microsoft.public.dotnet.framework.windowsforms too)

Hi,
Is there a way (.NET, P/Invoke) to access individual buttons in a
NumericUpDown and DomainUpDown controls?

I need to disable/enable each one of them separately
if the .Value is smaller than myMinValue, the upper button is disabled;
if the .Value is bigger than myMaxValue, the lower button is disabled and
the other one is enabled;

Thank you,
Daniel
Nov 16 '05 #1
3 2848
Daniel,

Unfortunately, this isn't possible with the NumericUpDownControl. The
reason for this is that the control uses one window for the up/down buttons
(so you can't disable a specific button), and the control doesn't expose a
windows message or some other mechanism to disable only one button.

Does not setting the Maximum and Minimum properties on the control suit
your needs? It will prevent a values outside of that range from being
entered.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bamse" <bd******@yahoo.com> wrote in message
news:uB**************@TK2MSFTNGP12.phx.gbl...
(this was posted on microsoft.public.dotnet.framework.windowsforms too)

Hi,
Is there a way (.NET, P/Invoke) to access individual buttons in a
NumericUpDown and DomainUpDown controls?

I need to disable/enable each one of them separately
if the .Value is smaller than myMinValue, the upper button is disabled;
if the .Value is bigger than myMaxValue, the lower button is disabled and
the other one is enabled;

Thank you,
Daniel

Nov 16 '05 #2
You could get the controls that make up the Numeric control out of the controls collection and disable/enable them individually.
Nov 16 '05 #3


the child controls are internal, so i can't access them from outside

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: | last post by:
Hi, I am setting the NumericUpDown .Value property and the ValueChanged event is NOT being fired. Does this ONLY get fired when I change it on the UI and not programatically? Thanks
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
2
by: A G Benny | last post by:
Hi, I have a numericupdown control in my form. I added a tool tip control and set the numericupdown control's property to show the tool tip text. But when i hover over the control, no tool tip...
10
by: Bonj | last post by:
I'm using a number of NumericUpDown controls on my form, which controls printer settings such as number of pages. However I want to override one of the default behaviours of the control, namely...
6
by: Kunkel | last post by:
Hi All i am trying to determine which button was clicked (up or down) on a numeric up down control. dotting into the e or sender objects do not provide any usefill information i need to execute...
3
by: abc my vclass | last post by:
My win-form have many numericupdown controls to applied. But numericupdown control don't like textbox, text box control can automatic selected text when got focus. Is there any method can let me...
4
by: illegal.prime | last post by:
Hey all, I have a NumericUpDown control on a Panel or potentially a Form that have AutoScroll enabled. When the NumericUpDown is active I would like the Form/Panel/whatever not to scroll when I...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
2
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello experts, I posted a disturbing question in here:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.