473,624 Members | 2,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Spinner Control

Hello.
Is there a way to make the spinner control "Rollover"

In other words, when we hit the down button on the control and reach
zero, if I press down again I would like it to rollover to 9.

And when I hit up and I finally come to 9, I would like the next up
press to hit 0.

I'm assuming I'll need to write the action myself, but I'm kind of at a
loss on how to handle this, or is there a default property that I can
modify to make this happen???

Thanks!!
Guy

Sep 19 '06 #1
6 12081
What's a spinner control? I checked through vis studio i can't find one?

Without knowing what it is though and assuming it acts like any other
control... just catch the click event on your up or down press and do:

//pseudo code on the up press

if(spinner.valu e >= 9)
spinner.value= 0;

//pseudo on the down
if(spinner.valu e <=0)
spinner.value= 9;

That help?

"Guy Noir" <ah******@gmail .comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
Hello.
Is there a way to make the spinner control "Rollover"

In other words, when we hit the down button on the control and reach
zero, if I press down again I would like it to rollover to 9.

And when I hit up and I finally come to 9, I would like the next up
press to hit 0.

I'm assuming I'll need to write the action myself, but I'm kind of at a
loss on how to handle this, or is there a default property that I can
modify to make this happen???

Thanks!!
Guy

Sep 19 '06 #2
Maybe I've misunderstood your requirements,
but in dotNet 1.1, using the 'NumericUpDown' control as the Spinner,

This code should do:

private void numericUpDown1_ ValueChanged(ob ject sender, System.EventArg s e)
{
if (numericUpDown1 .Value numericUpDown1. Maximum-1)
numericUpDown1. Value = numericUpDown1. Minimum+1;
if (numericUpDown1 .Value < numericUpDown1. Minimum+1)
numericUpDown1. Value = numericUpDown1. Maximum-1;
}

You would need to set the Minimum and Maximum to one lower and one higher
respectivley that the actual Min and Max you want the spinner to display.

Cheers,

Chris.

"Guy Noir" <ah******@gmail .comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
Hello.
Is there a way to make the spinner control "Rollover"

In other words, when we hit the down button on the control and reach
zero, if I press down again I would like it to rollover to 9.

And when I hit up and I finally come to 9, I would like the next up
press to hit 0.

I'm assuming I'll need to write the action myself, but I'm kind of at a
loss on how to handle this, or is there a default property that I can
modify to make this happen???

Thanks!!
Guy

Sep 19 '06 #3
Yesm sorrym numericupdown My bad :P
Thanks so much for the response. I'll give it a whirl.

-Guy

ChrisM wrote:
Maybe I've misunderstood your requirements,
but in dotNet 1.1, using the 'NumericUpDown' control as the Spinner,

This code should do:

private void numericUpDown1_ ValueChanged(ob ject sender, System.EventArg s e)
{
if (numericUpDown1 .Value numericUpDown1. Maximum-1)
numericUpDown1. Value = numericUpDown1. Minimum+1;
if (numericUpDown1 .Value < numericUpDown1. Minimum+1)
numericUpDown1. Value = numericUpDown1. Maximum-1;
}

You would need to set the Minimum and Maximum to one lower and one higher
respectivley that the actual Min and Max you want the spinner to display.

Cheers,

Chris.

"Guy Noir" <ah******@gmail .comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
Hello.
Is there a way to make the spinner control "Rollover"

In other words, when we hit the down button on the control and reach
zero, if I press down again I would like it to rollover to 9.

And when I hit up and I finally come to 9, I would like the next up
press to hit 0.

I'm assuming I'll need to write the action myself, but I'm kind of at a
loss on how to handle this, or is there a default property that I can
modify to make this happen???

Thanks!!
Guy
Sep 19 '06 #4
So, I tried this. The problem that I came across is that when the
counter has already reached Zero, the value does not change and thus
the numericUpDown1_ ValueChanged event is never fired?

Is there an event raised that tells us if the up or down control was
pressed?

I'm wanting to figure this out so I can write a user control that has
this method already included.

Thanks again.
-Guy
Guy Noir wrote:
Yesm sorrym numericupdown My bad :P
Thanks so much for the response. I'll give it a whirl.

-Guy

ChrisM wrote:
Maybe I've misunderstood your requirements,
but in dotNet 1.1, using the 'NumericUpDown' control as the Spinner,

This code should do:

private void numericUpDown1_ ValueChanged(ob ject sender, System.EventArg s e)
{
if (numericUpDown1 .Value numericUpDown1. Maximum-1)
numericUpDown1. Value = numericUpDown1. Minimum+1;
if (numericUpDown1 .Value < numericUpDown1. Minimum+1)
numericUpDown1. Value = numericUpDown1. Maximum-1;
}

You would need to set the Minimum and Maximum to one lower and one higher
respectivley that the actual Min and Max you want the spinner to display.

Cheers,

Chris.

"Guy Noir" <ah******@gmail .comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
Hello.
Is there a way to make the spinner control "Rollover"
>
In other words, when we hit the down button on the control and reach
zero, if I press down again I would like it to rollover to 9.
>
And when I hit up and I finally come to 9, I would like the next up
press to hit 0.
>
I'm assuming I'll need to write the action myself, but I'm kind of at a
loss on how to handle this, or is there a default property that I can
modify to make this happen???
>
Thanks!!
Guy
>
Sep 23 '06 #5
The OnClick event will always fire. All you have to do is figure out which
event is fired first, and handle it there.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

A watched clock never boils.

"Guy Noir" <ah******@gmail .comwrote in message
news:11******** *************@b 28g2000cwb.goog legroups.com...
So, I tried this. The problem that I came across is that when the
counter has already reached Zero, the value does not change and thus
the numericUpDown1_ ValueChanged event is never fired?

Is there an event raised that tells us if the up or down control was
pressed?

I'm wanting to figure this out so I can write a user control that has
this method already included.

Thanks again.
-Guy
Guy Noir wrote:
>Yesm sorrym numericupdown My bad :P
Thanks so much for the response. I'll give it a whirl.

-Guy

ChrisM wrote:
Maybe I've misunderstood your requirements,
but in dotNet 1.1, using the 'NumericUpDown' control as the Spinner,

This code should do:

private void numericUpDown1_ ValueChanged(ob ject sender,
System.EventArg s e)
{
if (numericUpDown1 .Value numericUpDown1. Maximum-1)
numericUpDown1. Value = numericUpDown1. Minimum+1;
if (numericUpDown1 .Value < numericUpDown1. Minimum+1)
numericUpDown1. Value = numericUpDown1. Maximum-1;
}

You would need to set the Minimum and Maximum to one lower and one
higher
respectivley that the actual Min and Max you want the spinner to
display.

Cheers,

Chris.

"Guy Noir" <ah******@gmail .comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
Hello.
Is there a way to make the spinner control "Rollover"

In other words, when we hit the down button on the control and reach
zero, if I press down again I would like it to rollover to 9.

And when I hit up and I finally come to 9, I would like the next up
press to hit 0.

I'm assuming I'll need to write the action myself, but I'm kind of at
a
loss on how to handle this, or is there a default property that I can
modify to make this happen???

Thanks!!
Guy

Sep 23 '06 #6
I don't know why this was so hard for me but a little further googling
revealed that I can override the methods DownButton and UpButton

Thanks all for your input.

=Guy
Kevin Spencer wrote:
The OnClick event will always fire. All you have to do is figure out which
event is fired first, and handle it there.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

A watched clock never boils.

"Guy Noir" <ah******@gmail .comwrote in message
news:11******** *************@b 28g2000cwb.goog legroups.com...
So, I tried this. The problem that I came across is that when the
counter has already reached Zero, the value does not change and thus
the numericUpDown1_ ValueChanged event is never fired?

Is there an event raised that tells us if the up or down control was
pressed?

I'm wanting to figure this out so I can write a user control that has
this method already included.

Thanks again.
-Guy
Guy Noir wrote:
Yesm sorrym numericupdown My bad :P
Thanks so much for the response. I'll give it a whirl.

-Guy

ChrisM wrote:
Maybe I've misunderstood your requirements,
but in dotNet 1.1, using the 'NumericUpDown' control as the Spinner,

This code should do:

private void numericUpDown1_ ValueChanged(ob ject sender,
System.EventArg s e)
{
if (numericUpDown1 .Value numericUpDown1. Maximum-1)
numericUpDown1. Value = numericUpDown1. Minimum+1;
if (numericUpDown1 .Value < numericUpDown1. Minimum+1)
numericUpDown1. Value = numericUpDown1. Maximum-1;
}

You would need to set the Minimum and Maximum to one lower and one
higher
respectivley that the actual Min and Max you want the spinner to
display.

Cheers,

Chris.

"Guy Noir" <ah******@gmail .comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
Hello.
Is there a way to make the spinner control "Rollover"
>
In other words, when we hit the down button on the control and reach
zero, if I press down again I would like it to rollover to 9.
>
And when I hit up and I finally come to 9, I would like the next up
press to hit 0.
>
I'm assuming I'll need to write the action myself, but I'm kind of at
a
loss on how to handle this, or is there a default property that I can
modify to make this happen???
>
Thanks!!
Guy
>
Sep 25 '06 #7

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

Similar topics

4
2277
by: Vinod | last post by:
Hi, I want to know how we can create a time spinner , similar to the the one which we can see in Date/Time properties , when we click it. I want to include it in my asp program. Thanks in advance
1
1412
by: MSDousti | last post by:
Hello I want to put a Spinner and set an Edit to its Buddy. I have some problems: 1- I want the spinner to add/subtract 0.01 to/from the number shown in Edit, but it just works with integers(0,1,2,3,etc.) 2-When I press ENTER on the Edit box, it terminates my program and returns to my code (without any error)
1
8715
by: Macca | last post by:
hi, I am looking to use the date/time picker control to allow the user to select a time. I have done a similar thing in a C++ project by formating the date time picker to show only the time and then using a spinner control as a buddy control to allow the user to cycle through the hour/minute/second without the need for a keyboard,(as my app is being run on a touchscreen).
8
9968
by: felecha | last post by:
Is there a control that I can put on a Form that would let a user select just the month value? I tried to find a way to make the DateTimePicker or the Month Calendar do what I want but I can't. I want a way for the user to say "Let me see what is in the database for the month of January 2004." I don't want to have it specified as January 1 through January 31. I can do that in code behind it. I could use a combo, and just enter ...
1
2685
by: JLD | last post by:
I need to know the commands in DOS to create a batch file that produces a spinner in DOS. I am in desperate need. I have searched all over the web and have found nothing. I also need to know if I can save it to a CD or not. Can anyone help me please!?
3
9649
by: Bert | last post by:
Hi I am trying to load my user control in a placeholder, i get an error: c:\inetpub\wwwroot\testinline\WebForm2.aspx.vb(26): Type 'WebUserControl6' is not defined? Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
0
1265
by: Microsoft Newsserver | last post by:
Hi I need a client side spinner control. But I want the increments to speed up the longer the mouse button is pressed. Does anyone know of a free or cheap one I can lay my hands on. Cheers.
7
8817
by: kevin cline | last post by:
When posting an AJAX request to update multiple page elements, how do I display a spinner in the elements until the request completes?
1
1952
by: Brian | last post by:
How do i make the spinner control... spin the time... like the windows time setting?
0
8681
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
8629
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
8341
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
7170
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...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
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
4084
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
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1488
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.