Avatar of Chris Millard
Chris MillardFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

Up / Down character boxes - Visual Basic 2010

I want to have a form that has two text boxes side by side. Both text boxes will have an up arrow above them, and a down arrow below.

I want the user to have to use the up and down arrows to scroll through some single character - not type into the boxes manually.

On the first box, the user should be able to scroll up or down to pick letters A, E, I, O or U.

Depending on what letter is in box 1, depends on what values are available for box 2.

How would I achieve this?
Visual Basic.NET

Avatar of undefined
Last Comment
nixkuroi
Avatar of Molly Fagan
Molly Fagan
Flag of United States of America image

Use combo boxes and once the user selects the value from the first combo box, clear out the second combo box (for user friendliness, you'd want to, by default, populate the second combo box with the values that match the displayed item in the first combo box) and populate the values that go with the choice.
Avatar of nixkuroi
nixkuroi

What you want is the ButtonSpinner control from extended WPF Toolkit

Here is the link for the code:
http://wpftoolkit.codeplex.com/

Here's a link for how to implement it:
http://elegantcode.com/2010/11/07/extended-wpf-toolkitrelease-1-2-0/

If you're using Silverlight, you can install the Silverlight Toolkit:

Download code here:
http://silverlight.codeplex.com/releases/view/43528

Code and samples here
http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html

Avatar of Chris Millard
Chris Millard
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Both of these solutions appear to use arrows to the side of the text - whereas I want to have the up and down arrows above and below the text respectively.
You could easily build a UserControl that encapsulates a Label and Buttons laid out exactly as you desire...

What are you working in?  WebForms, WinForms, WPF...
Avatar of Chris Millard
Chris Millard
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

It's a Windows Form...
Avatar of nixkuroi
nixkuroi

Oh,  then you want the NumericUpDown class.  

http://msdn.microsoft.com/en-us/library/system.windows.forms.numericupdown.aspx

If you scroll to the bottom, there's example code.
ASKER CERTIFIED SOLUTION
Avatar of Molly Fagan
Molly Fagan
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of nixkuroi
nixkuroi

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Visual Basic.NET
Visual Basic.NET

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,

96K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo