• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 326
  • Last Modified:

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?
0
Chris Millard
Asked:
Chris Millard
  • 4
  • 2
  • 2
  • +1
2 Solutions
 
Molly FaganApplications Team SupervisorCommented:
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.
0
 
nixkuroiCommented:
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

0
 
Chris MillardAuthor Commented:
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.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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...
0
 
Chris MillardAuthor Commented:
It's a Windows Form...
0
 
nixkuroiCommented:
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.
0
 
nixkuroiCommented:
0
 
Molly FaganApplications Team SupervisorCommented:
Based on the problem description, more than just numbers will be used for the user to select.  Again, I would use a combo box (I have a problem that I use to select a database, then based on the database selected, it will show all of the tables within the database and based on the table selected, show the fields--using combo boxes).

ComboBox1.DataSource = (whatever you're using for a datasource)

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboDatabases.SelectedIndexChanged
       
     ComboBox2.Clear()

     'Do some checking here of what was selected in ComboBox1

     ComboBox2.Datasource = (set datasource based on what was selected--again, not sure what you're using for a datasource)
       
End Sub
0
 
nixkuroiCommented:
Ah, of course - What I meant was the DomainUpDownControl, which handles strings:

Documentation and sample code can be found here:  
http://www.c-sharpcorner.com/UploadFile/mahesh/1743/

and here:

http://msdn.microsoft.com/en-us/library/system.windows.forms.domainupdown(v=vs.71).aspx
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now