473,327 Members | 1,936 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,327 software developers and data experts.

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 12046
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.value >= 9)
spinner.value= 0;

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

That help?

"Guy Noir" <ah******@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.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(object sender, System.EventArgs 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.googlegro ups.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(object sender, System.EventArgs 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.googlegro ups.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(object sender, System.EventArgs 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.googlegro ups.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*********************@b28g2000cwb.googlegro ups.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(object sender,
System.EventArgs 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.googlegro ups.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*********************@b28g2000cwb.googlegro ups.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(object sender,
System.EventArgs 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.googlegro ups.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
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...
1
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...
1
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...
8
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. ...
1
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...
3
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...
0
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
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
by: Brian | last post by:
How do i make the spinner control... spin the time... like the windows time setting?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.