473,545 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting multiple textboxes values stored in list to retrieve from other method

1 New Member
The only way I can use my list is storing all my code in my button click event, need help on were to store input values retrieved 4 textboxes. This is what I have...

// submit button click
private void submitButton_Cl ick(object sender, EventArgs e)
{
// input values from user in textboxes
int firstValue = int.Parse(first TextBox.Text);
int secondValue = int.Parse(secon dTextBox.Text);
int thirdValue = int.Parse(third TextBox.Text);
int fourthValue = int.Parse(fourt hTextBox.Text);
int fifthValue = int.Parse(fifth TextBox.Text);

// create a list of textboxes user input
List<int> values = new List<int>();
values.Add(firs tValue);
values.Add(seco ndValue);
values.Add(thir dValue);
values.Add(four thValue);
values.Add(fift hValue);
values.Sort();

// create values for checkboxes
int max;
double avrg;
int min;

// set values of checkboxes
max = values.Max();
avrg = values.Average( );
min = values.Min();
Jun 6 '16 #1
1 1258
Luk3r
300 Contributor
Just make this public
Expand|Select|Wrap|Line Numbers
  1. List<int> values = new List<int>();
Jun 6 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

66
4909
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
4
10638
by: randy.p.ho | last post by:
Using JDBC, is there a way to call a stored procedure with multiple return values? Thanks.
4
2551
by: cwwilly | last post by:
Hello, Thanks for taking a look at this! Problem: I'm trying to pass multiple dynamic values between a slaveform and a masterform. The problem I'm having is on the slaveform I loop through multiple records and want two values depending on the row they select. slaveform: x=selected
4
2626
by: Amy | last post by:
Hello, I've been struggling to learn C#.NET for a while now. I've made some progress, but I'm easily stumped. :( What's stumping me today is this: I've got a stored procedure (SQL) that returns one row from a table, and up to 3 rows from another table. I want to read the values of the three rows into an array, but I can't figure out...
2
6813
by: bienwell | last post by:
Hi all, I've got a problem with getting the data values from multiple selections in the list box. I could only get the value and the index of the first item from the selection, but not the others. The data loaded for the Listbox (FieldList) is from data table. I already set the property SelectionMode="Multiple" for the FieldList . Users...
8
5186
by: aleksandar.ristovski | last post by:
Hello all, I have been thinking about a possible extension to C/C++ syntax. The current syntax allows declaring a function that returns a value: int foo(); however, if I were to return more than one value, for example three int-s, I would have to change my "logic" and pass the references to my
1
1594
by: flashguy | last post by:
In the form, i wanted to contain multiple textboxes that submits to the same field. However, when i start adding info to the text box, all other bounded textboxes for the same field will be mirrored. The Version is ACCESS 2000 Is there any way around this?
7
27784
by: narpet | last post by:
Hello all... I have a list box that is pulling it's data from a sql table. I have its selection mode set to multiextended. I have the display member for each item set to the Name field from the sql table and the value member for each item set to the ID field from the sql table. When I select multiple items from the list, how do I get the...
1
3325
by: balurbabu | last post by:
I am asp.net 2.0 c#.net, I have a list box,listLocation which allows the user to select mulitple selections. These are stored in a database as comma separated values like bangalore,chennai,delhi .Now i want to highlight multiple selected values in listbox while updating...i.e..when i click update button, i want the earlier selectd locations...
2
2383
by: vk2012 | last post by:
I am trying to plot a graph that takes a range of xvalues stored in a list and a function 'y' that takes those values as one of its operand . 'y' values are also stored in another array for each of xvalues. I am generating a range of xvalues through random function, that will be stored in a list . For each xvalue i am calculating log value and...
0
7479
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7411
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5987
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4962
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3468
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.