473,769 Members | 6,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

numericUpDown but with non-numeric items.

I would like to use the numericUpDown in it standard way but have to
features. I would like to display items instead of numbers that amp to the
numbers and have the control be "cyclic" in the sense that once it reaches
its maximum value it goes to its min and vice versa.

What I essentially want is to display something like
SomeArrayList[numericUpDown1. Value] instead of Value. I tried to override
the UpdateEditText but the problem is that now the user can enter numbers in
the text box of the numeric control. So I need to disable that in some way.

I also need to make it "cylical" but I think thats easy enough by just
adding to the changed value event.

So I guess the real issue is somehow disabling the user from entering input
to the numeric contro's text box and force it to use the up/down arrow keys
or the mouse.

Now, I also tried to use a combo box and this has similar issues(although
I'd rather use the numeric control as it allows me to get the index of the
entry directly which is easier to work with).

Is there a control that does what I want or do I have to modify my own?

Thanks,
Jon
Nov 20 '06 #1
6 2245
do one control, yourselft.

Regards,

Bela Istok
"Jon Slaughter" <Jo***********@ Hotmail.comwrot e in message
news:mq******** *********@newss vr14.news.prodi gy.com...
>I would like to use the numericUpDown in it standard way but have to
features. I would like to display items instead of numbers that amp to the
numbers and have the control be "cyclic" in the sense that once it reaches
its maximum value it goes to its min and vice versa.

What I essentially want is to display something like
SomeArrayList[numericUpDown1. Value] instead of Value. I tried to override
the UpdateEditText but the problem is that now the user can enter numbers
in the text box of the numeric control. So I need to disable that in some
way.

I also need to make it "cylical" but I think thats easy enough by just
adding to the changed value event.

So I guess the real issue is somehow disabling the user from entering
input to the numeric contro's text box and force it to use the up/down
arrow keys or the mouse.

Now, I also tried to use a combo box and this has similar issues(although
I'd rather use the numeric control as it allows me to get the index of the
entry directly which is easier to work with).

Is there a control that does what I want or do I have to modify my own?

Thanks,
Jon

Nov 21 '06 #2

"Bela Istok" <be****@hotmail .comwrote in message
news:um******** ******@TK2MSFTN GP02.phx.gbl...
do one control, yourselft.

Regards,

Thats what I'm doing but I don't want to start from scratch. The
numericUpDown doesn't seem to allow one to do much configuring though.
Nov 21 '06 #3
So, the DomainUpDown, then...

using (Form f = new Form())
using (DomainUpDown dud = new DomainUpDown())
{
dud.Items.AddRa nge(new string[] { "a", "b", "c", "d" });
dud.Wrap = true;
dud.SelectedInd ex = 0;
f.Controls.Add( dud);
Application.Run (f);
}

Marc
Nov 21 '06 #4

"Marc Gravell" <ma**********@g mail.comwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
So, the DomainUpDown, then...

using (Form f = new Form())
using (DomainUpDown dud = new DomainUpDown())
{
dud.Items.AddRa nge(new string[] { "a", "b", "c", "d" });
dud.Wrap = true;
dud.SelectedInd ex = 0;
f.Controls.Add( dud);
Application.Run (f);
}

Marc

Thanks. Pretty must exactly what I need. It would be nice though if it could
also drop drown like a combo box for quick access to the list? (I don't
think this control as this ability though ;/

There also seems the issue of the user entering in text. They can enter in
random stuff that doesn't match anything in the list ;/

Thanks though, this should work for now atleast.

Jon
Nov 21 '06 #5
ReadOnly disables the user editing - it does not (despite the name) make it
fully read-only; enabled handles that...

But no drop down... sorry...

Marc
Nov 21 '06 #6

"Marc Gravell" <ma**********@g mail.comwrote in message
news:ey******** ******@TK2MSFTN GP04.phx.gbl...
ReadOnly disables the user editing - it does not (despite the name) make
it fully read-only; enabled handles that...
yep, just saw that. Thanks for point it out though.
But no drop down... sorry...
Ok, no big deal. Might try to implement a custom control based on it later
though. Just trying to get a small app done so don't need it to be perfect.

Thanks,
Jon
Nov 21 '06 #7

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

Similar topics

21
9923
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
10
7145
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 when it is tabbed into (selected), I want the number that is displayed in it to become selected, so the user can just type straight over it. For this I'm using the event handler: private void UpDown_Enter(object sender, System.EventArgs e) {...
0
1437
by: Koert | last post by:
Hi In the NumericUpDown control I have to detect that Tab was pressed so I have inherited the NumericUpDown and overroden the PreProcessMessage function. In the DateTimePicker (for example) this works fine but not in the NumericUpDown. It seams that the debugger does not access the PreProcessMessage function. Is this a bug in the NumericUpDown control? Is there an other way to detect that the Tab was pressed in the control thanks, Koer
3
30168
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 set all numericupdown autoselect text when gotfocus?
4
4690
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 scroll the value in the NumericUpDown. I can add an additional handler to the MouseWheel event on the NumericUpDown, but how do I stop the Form/Panel/Whatever from scrolling when the value is changing in the NumericUpDown?
5
2179
by: Len Weltman | last post by:
I am trying to pass a NumericUpDown object into a class method using Visual Studio 2005, but the control type is not found in Intellisense and the type declaration is flagged as an error. Here is a code sample (which doesn't work): *** Begin code ***
2
2781
by: Stephan Zaubzer | last post by:
Hi all, I encountered a problem with NumericUpDown yesterday and managed to reproduce the error with a very easy examle. I have a Windows Application with only one Form, which contains only one NumericUpDown control and nothing else. This is the only code I wrote: (everything else was done with the designer of Visual Studio).
2
3921
by: Steve | last post by:
Hi All I am using a numericupdown in a VB.net 2005 App and set the interceptarrowkeys property to false when not in edit mode The numericupdown still scrolls the value when I click on the arrows?? Is there a known bug in this control??
2
2394
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello experts, I posted a disturbing question in here: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.languages.csharp&mid=dedc665f-91c0-4fa4-a103-a98a6808759c But no one have answered it. Is not clear? or maybe it a Framework bug? Please help.
7
4565
by: pamela fluente | last post by:
My numericUpDowns show numbers in the format 1.500,56 (italy). Instead, I need *invariantly* that they show and accept the format 1,500.56, as in the USA. What's the right way to do that? I have tried to set the current culture to the US culture, but nothing changed. For instance I tried without success (vb) :
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.