Results 1 to 19 of 19

Thread: [RESOLVED] Where is the Spin Ctrl in VB?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2025
    Posts
    178

    Resolved [RESOLVED] Where is the Spin Ctrl in VB?

    Hi, I'm used to working in VBA and there is a spin ctrl in the toolbox, but in VB I have not been able to find one. Do they exist any more?

    I am converting a VBA over to VB to utilize more features VB has to offer.

    I read that it's from an Active X component, but I can't find where they are or how to install them.

    Thanks.

    EDIT: I'm using VS 2022
    Last edited by FunkMonkey; Mar 11th, 2025 at 07:52 PM.

  2. #2
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,790

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by FunkMonkey View Post
    EDIT: I'm using VS 2022
    So to be very clear, you're using VB.Net? If so this thread needs to be moved to the VB.Net section.

    As for the spin control, are you talking about the NumericUpDown control?
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #3
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,932

    Re: Where is the Spin Ctrl in VB?

    You use the UpDown control from one of the common controls ocxs and set its "buddy" control to a textbox.

    in vb6, not .NET, just saw the edit.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Mar 2025
    Posts
    178

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by Niya View Post
    So to be very clear, you're using VB.Net? If so this thread needs to be moved to the VB.Net section.

    As for the spin control, are you talking about the NumericUpDown control?
    Yes, please move sorry

    But there is no Numerical Ctrl. I would have used that as that is what I have in VBA. So where can I find it?

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,066

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by FunkMonkey View Post
    But there is no Numerical Ctrl.
    No, but there is a NumericUpDown control, which is what was said.
    Quote Originally Posted by FunkMonkey View Post
    So where can I find it?
    You can find it in the Toolbox, just like the rest of the controls you use. It's in the Common Controls section by default, so if it's not there in your VS then you removed it. You can either add it back explicitly or reset the Toolbox to its original state. It's also in the All Windows Forms section, along with the DomainUpDown control. If you actually don't want to use that control - it's not clear from your posts whether that's the case or not - then you'll need to find an alternative yourself. If that means some ActiveX control then you can add it to the Toolbox with a right click and browsing on the COM Components tab.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Mar 2025
    Posts
    178

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by jmcilhinney View Post
    No, but there is a NumericUpDown control, which is what was said.

    You can find it in the Toolbox, just like the rest of the controls you use. It's in the Common Controls section by default, so if it's not there in your VS then you removed it. You can either add it back explicitly or reset the Toolbox to its original state. It's also in the All Windows Forms section, along with the DomainUpDown control. If you actually don't want to use that control - it's not clear from your posts whether that's the case or not - then you'll need to find an alternative yourself. If that means some ActiveX control then you can add it to the Toolbox with a right click and browsing on the COM Components tab.
    It's not there, nor did I delete it. I need the control why would I delete it. Besides I don't even know how to delete it. Other than drag/drop I would not be able to.

  7. #7
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,368

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by FunkMonkey View Post
    It's not there, nor did I delete it. I need the control why would I delete it. Besides I don't even know how to delete it. Other than drag/drop I would not be able to.
    Why it's not there isn't really the issue. If it's not in the toolbox then add it back like jmc suggested.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Mar 2025
    Posts
    178

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by wes4dbt View Post
    Why it's not there isn't really the issue. If it's not in the toolbox then add it back like jmc suggested.
    That would be great but HOW?? I looked in .Net Frameworks Component/Com/Universal windows. It's not there, so how do I get it?

  9. #9
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,368

    Re: Where is the Spin Ctrl in VB?

    If you went to Choose toolbox items ->.Net Frameworks Components and the NumericUpDown wasn't listed you have something wrong with your VS 2022 installation. Try modify/reinstall Visual Studio 2022

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,066

    Re: Where is the Spin Ctrl in VB?

    I just checked a .NET 8 project to make sure that it behaves the same way as a .NET Framework project and it does. When editing a form in the designer I see this:

    Name:  Screenshot 2025-03-13 131352.png
Views: 177
Size:  16.5 KB

    and this:

    Name:  Screenshot 2025-03-13 131918.png
Views: 152
Size:  25.0 KB

    and, when I right-click and select Choose Items, I see this:

    Name:  Screenshot 2025-03-13 131745.jpg
Views: 154
Size:  45.9 KB

    Having said that, NumericUpDown is not checked in that dialogue for a .NET 8 project, while it is for a .NET Framework project, so I'm not exactly sure that the Toolbox can be edited the same way for both.

    Regardless, I would start by right-clicking within the Toolbox and selecting Reset Toolbox, which will return it to its default state. If that doesn't work then, as suggested, there's an issue with your VS installation and you should repair it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Mar 2025
    Posts
    178

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by wes4dbt View Post
    If you went to Choose toolbox items ->.Net Frameworks Components and the NumericUpDown wasn't listed you have something wrong with your VS 2022 installation. Try modify/reinstall Visual Studio 2022
    OHHHH. I was looking for spin button. Thanks! That's what VBA calls it.

  12. #12
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,066

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by FunkMonkey View Post
    OHHHH. I was looking for spin button. Thanks! That's what VBA calls it.
    Perhaps you should have read posts #2 and #5 then.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Mar 2025
    Posts
    178

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by jmcilhinney View Post
    Perhaps you should have read posts #2 and #5 then.
    Their not the same. Completely different, so I'll have to adjust my code to work with this.

  14. #14
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,978

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by FunkMonkey View Post
    Hi, I'm used to working in VBA and there is a spin ctrl in the toolbox, but in VB I have not been able to find one. Do they exist any more?

    I am converting a VBA over to VB to utilize more features VB has to offer.

    I read that it's from an Active X component, but I can't find where they are or how to install them.

    Thanks.

    EDIT: I'm using VS 2022
    I think I remember the spin control from classic vb.
    In vb.net there are numeric updown controls, which is basically a decimal input textbox, with a dedicated spin control built in. There is also a domain updown control with a built in spin control. This can be used with any list, i.e. numbers, strings, etc…

  15. #15
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,792

    Re: Where is the Spin Ctrl in VB?

    I feel that the NumericUpDown control is perhaps not the best control in .NET. Those buttons really add very little. They do indicate that only numbers can be used, but who is going to sit there clicking the up button to enter a value? The mouse wheel might be somewhat better, and I don't know how that behaves with a NumericUpDown, but even so, spinning the mouse wheel is an imprecise way to enter a number.
    My usual boring signature: Nothing

  16. #16

    Thread Starter
    Addicted Member
    Join Date
    Mar 2025
    Posts
    178

    Re: Where is the Spin Ctrl in VB?

    Quote Originally Posted by Shaggy Hiker View Post
    I feel that the NumericUpDown control is perhaps not the best control in .NET. Those buttons really add very little. They do indicate that only numbers can be used, but who is going to sit there clicking the up button to enter a value? The mouse wheel might be somewhat better, and I don't know how that behaves with a NumericUpDown, but even so, spinning the mouse wheel is an imprecise way to enter a number.
    Hello Shaggy. Just before I close this I wanted to reply.

    I do need the NumericUpDown, but more like the spinner in VBA. It is used to shift between templates for selecting a template, so when they press one of the directions the next template will show up. Sometimes there are only 1 sometimes there are 5, or more. This makes it easier to control the selection of the template to select. With the number available, I'm not sure how that is going to play a role in confusion for the user. These templates could be in the middle of other templates, I sort out which template section to set the min/max values to for the spinner.

    Thaks for the support

  17. #17

  18. #18
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,066

    Re: [RESOLVED] Where is the Spin Ctrl in VB?

    If these templates are being represented by a name or other text then the DomainUpDown is a more appropriate choice but, if they are being represented by a number and that numeric sequence is unbroken then the NumericUpDown is also fine. That said, I think that most people would probably use a ComboBox for this, rather than any up/down control. There's a drop-down button instead of a spinner button and you can still use the arrow keys to scroll through the items in the same way as an up/down control. One thing about an up/down control is that, without typing a value, you must go through intermediate values and may thus raise multiple ValueChanged events, possibly doing pointless intermediate work. With a ComboBox, you can select an item anywhere in the list with two clicks, so you don't need to select the items in between and raise unnecessary events.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  19. #19
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,792

    Re: [RESOLVED] Where is the Spin Ctrl in VB?

    I was thinking that crafting some kind of continuously scrolling control might work well, but that would take a fair amount of work, and it only makes sense if the templates have meaningful names such that users would know to choose A versus B.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width