473,478 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Create 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_Click(object sender, EventArgs e)
{
// input values from user in textboxes
int firstValue = int.Parse(firstTextBox.Text);
int secondValue = int.Parse(secondTextBox.Text);
int thirdValue = int.Parse(thirdTextBox.Text);
int fourthValue = int.Parse(fourthTextBox.Text);
int fifthValue = int.Parse(fifthTextBox.Text);

// create a list of textboxes user input
List<int> values = new List<int>();
values.Add(firstValue);
values.Add(secondValue);
values.Add(thirdValue);
values.Add(fourthValue);
values.Add(fifthValue);
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 1257
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
4896
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
10621
by: randy.p.ho | last post by:
Using JDBC, is there a way to call a stored procedure with multiple return values? Thanks.
4
2537
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...
4
2619
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...
2
6803
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...
8
5161
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...
1
1587
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....
7
27774
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...
1
3319
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...
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...
0
7027
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,...
0
6899
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...
0
7067
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5312
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,...
1
4757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2980
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...
0
2970
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1288
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 ...
1
555
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.