Get User Input Into Array
May 17, 2011In my program, I need to have the user input a list of numbers separated by commas. How would I go about storing those numbers? Would I put them into an array? If so, how?
View 5 RepliesIn my program, I need to have the user input a list of numbers separated by commas. How would I go about storing those numbers? Would I put them into an array? If so, how?
View 5 RepliesI am trying to make a program using Visual Basic that will allow the user to add links to web pages (such as www.google.ca) to a list in the program and make it so that they do not dissapear once the program is closed.
So to get into more detail, I have a text box, a listview, and a button. When the user types a link into the text box it needs to be put into an array (called "addlink") and then when the user presses the button, the link is typed into the listview as an object.
Then if the user clicks on that object in the listview, it will open up the browser using the WebBrowser command. How do I set the text in the textbox to an array once the button is clicked?
Specifications:
OS: Windows 7 Ultimate Edition
Software: Microsoft Visual Basic 2010 Express
Experience with Visual Basic: Average
how to pass user entered data (from a textbox) to an array? All the examples I have found show how to populate an array with predefined values. Heres what I've got, its messing and not close to what I want.
Private Sub AddButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddButton.Click
Dim AddNumInteger As Integer
[Code].....
When the users clicks the add button the value they entered in the NumAdd textbox is sent to an element?
? How do I use an array to store user input collected instead of storing the data in individual variables?
View 3 RepliesI have 10 constant arrays of data that can be used throughout the program.[code]I also have an array that needs to be populated randomly depending on user input.array_user(8)If the user selects 3 for instance...I need the data in array_user to be populated by the data in array03.I know I can do that with if/then statements...but I'm sure there is a much simpler way to do it.
View 1 RepliesI'm trying to make a program where user can input data from a textbox into an array and when the user hit the enter key, it compare it to a data grab from a text file. Here is my code so far:
Private Sub TextBox_KeyDown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox.TextChanged
Dim input As String
[Code]....
I got the part where the program can graph data from text file and put it into an array called "varia3". The part I could not get is allowing user to enter data into the textbox. When I run the program, the sec I try to enter a letter or number into the textbox the program ended.
How do I prompt the user to input elements in a two dimensional array? And how do I then save the output?I've figured out how write and print a program where the program provides the elements (see short version below), but I can't work out how to get the user to input the elements instead.
Solfa(0, 0) = 11
Solfa(0, 1) = 12
Solfa(1, 0) = 21
[code].....
how to do array of textboxes when a user input a number of textbox to be loaded and when the button clicked, the array of textbox that the user enters will appear?
View 1 RepliesI'm trying to code an 'increase' button to prompt a user to input a rate by which to increase select prices in an array.It should request the increased rate, then request a number from one to five, representing which price in the array to increase.Then, if 'increase' button is selected again and another number from one to five is chosen, then that element should be increased.It's working, but all the numbers in the array are changed. And, when I hit the increase button again, the array is repopulated below the first price increases instead of only replacing the designated price.
'declare 5 element array of prices
Dim prices() As Double = {12.2, 8.5, 12, 50, 2.4}
Dim rateIncrease As Decimal
Dim isConverted As Boolean
[code].....
I need some help with the input validation of my application. Attached is the code that I have written as well as a screenshot of the front end. I specifically need input validation to verify that the user selected input for cbLengthOfStay is a number between 1-10 as well as input validation to verify the user input for txtMedication, txtSurgicalCharges, txtLabFees and txtRehabilitation is a positive numerical number. Please feel free to critique my attached code. [Code]
View 2 RepliesIf my Category and Forum selection is incorrect I am sorry and feel free to move it. I'd like to have the users input in the message box that will show. For example: There is a textbox and the user puts in their name as Bob. Then the message box would be: What my main goal is, is being able to include the users input they type inside the textbox inside the message box.
View 6 RepliesOption Strict On Public Class Form1 Private Sub btnDistance_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDistance.Click 'The btnEnterSpeed click event accepts and displays up to ten speeds from the user'and then calculates and displays average speed
[Code]...
I cannot figure out how to incorporate the number of days into the input box then get it to loop and count the number of times the User inputs in the number of days. Then I have to incorporate it into the equation to get the total distance D = MPH * Hours. What I have right now wil not count up the number of days and locks up after I input one number and will not add anything to the listbox. Because I also have to make sure that they cant add nonnumaric values and the number of hours per day cannot exceed 20. I have put things in and taken them out but it has been 2 days and I am lost now
Per this UserControl that can be added to a blank form, I would like to use the HorizUnits array below to map custom grid x coordinate from a mouse x position.For a given input value 13, what syntax would I use to obtain a value of 2 where 13 lies between Value 10 and 16 for which 2 (Name) would be the custom grid's displayed coordinate position?
View 1 Repliesn my project i am to enter a name and a test mark into two separate text boxes and then select the button to store the information into the arrays, one array for names and another for marks, but when it is reset using the Erase <Array> fuction andi try to re enter information, no matter what information is entered i get a "Null Reference Exception Unhandled" Error.I am using Visual Basic 2008.My code is as it says from now:
Public Class frmAdverageTestMarkCalculator
Dim ClosingMsg As String
Dim Closingtitle As String
[code].....
I'm trying to save what the user types in the vb code Dim user as Inputbox("") for example in a .txt file i can save the textbox and listbox but i cnt figure out how to save the inputbox i really need this to be saved the most.
View 7 RepliesI am creating a form for work where managers can report when they find a customer's personal information laying around on a desk (we work at a call center where agents answer calls for a wireless cell phone provider, so we take personal information security very seriously). Anyway, I am wondering if there is a way to have a text box autofill with that manager's windows username (since they will need to be logged into their own profile to use the form).
View 2 RepliesI need something tje user can type in data to such a parts QTY cost etc. There are no predefined parts list so the user can enter any part name/Number and there is no limit to amount of parts that can be entered.
Does anyone have any idea what might be useful. It was thinks of a listview bu i can't see that you can type into that. I cant use comboboxs because there are no predefined list and i know there is some way to generate text at runtime (i think) but i don't know how to do it and i would prefer a clearer approach.
I have 2 pages, one is HTML and the other is ASPX. In the HTML I am able to get input from a user and then process a return email to them.The HTML looks like this:
<input type="text" class="input" value="e-mail" id="txtEmail" name="contactEmail" onclick="SelectAll('txtEmail');" >
[code]....
Do anybody know how to input value to array? I know how to input the value by editing the code but I want to let users to enter value by themselves (such as using a input box). Plz help!
View 3 RepliesI have a table in my DB that needs to be updated. Whats a good way for a user to enter these 50 or so changes and have it update the db.
View 1 RepliesI'm converting a user generated list box to an array and then generating a user defined number of random strings and placing it in a textbox.The code I have works fine as it will generate the number of random strings the user wants, except sometimes a line is blank at the top of the list but is counted as a string.
View 4 Repliesim creating a simple program where the user inputs there own numbers in a textbox and the program works out the total and average and produces a bar chart.I have done the hard part of creating the bar chart, but i am stuck on using the numbers in the text box from the array.This is the code for my array lists:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles graph_btn.Click Dim aMonths As ArrayList = New ArrayList(), aAmounts As ArrayList = New ArrayList()
aMonths.Add("1")
aMonths.Add("2")
aMonths.Add("3")
aMonths.Add("4")
[Code]...
My winforms application will display 100 different names, and I will need the user to enter a number 1 through 4 next toeach name.I will then store this data.I know I can use the spreadsheet control,but is there something much simpler that I can use? Maybe an array of textboxes or a datagrid?
View 3 RepliesI am trying to have my program time out if the user lets it sit idle for an amount of time. Is there an easy way to find the last user input? I am using VB.NET.
View 4 RepliesIf Not IsNumeric(textbox1.Text) Then
KeyAscii = 0
End If
I learned in MSDN and wrote those code,but it doesn't work. This code " KeyAscii = 0" it's not correct, I just want to cancel the input, for instance,if user input 1a, then "a" will be not inputted into textbox, but "1" will leave.
sample of codes that i use to insert the data in my table, it works just fine but the problem is that i cant limit my user for example from entering null values, or integers into string or strings into integer,,,,, I also ask for assistance on how to handle any errors in my system from crashing.
Dim conn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "MOMSTEST.mdb;")
Dim Comm As New OleDb.OleDbCommand
[code]....
On my main form i need to pop up a sub form and await user input before proceeding. I am able to pop the form but not able to pause code excecution until the user input is there. Here is what i have tried:
If chk_athor_cobb_scholi.Checked = True Then
Vselect.Visible = True
While Vselect.ex2 = False
[Code].....
The problem of course is that the while loop causes a crazy infinite loop and locks the program down during excecution. How do i await the user input?
I'm having trouble using Visual Basic. It's my first time with the program that my college course is requiring I use. I'm having problems programing the script for an application. It's suppose to take the rate of a bunch of employees that are programmed into the application using an array, and multiply it by a decimal number that the user inputs into the application.
View 5 RepliesHow can I get my app. to remember the text that was enterd into a TextBox by a user?
View 3 RepliesI have followed a tutorial at url.... It is a very good tutorial but it is also a little dated. Most people who visit it praise it to high heaven so I decided it was a good place to start as an absolute beginner to programming. (I have teamed it up with Dan Mabbut Vis basic tutorial at about.com and joined DreamInCode in order to learn what I can accomplish with Visual Basic 2008 Express ). I am up to part 6 of 7 but keep going back to part 4 because there is one aspect I just cant work out.I am creating a form which logs staff in or out of work and allows staff to include a message with their ( at work /away from work ) status details on the form.The form is supposed to update a users status in a new row when they click a button. In my form the rows per user are being over-written with the updated information - it is not being written in a new row. There is a login form which precedes the staff status form - this has a little relevant code re calling the user info from the database but I think my problem is related to the insert statement in the middle of the below code.[code]
My code has changed quite a bit since the above as the form has progressed but the problem started at the stage above and has not changed with the forms progression. Every other aspect of staff update info is working well in my form - just not in a new row.I am going bald - The tutorial was written for VB2005 Express - I am using VB2008 Express though it has not made too much difference to the tutorial.