TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Masoud A
NA
30
18.9k
Add input from Textbox to listbox by using Dynamic array C#
May 13 2015 10:06 PM
Greetings,
I am stuck at this project quite a bit now, was wondering if anyone here can help me out :)
The scenario of this project is "User gives some value as input by textbox and they'll be added to first listbox "
Vertical
ly" by clicking the first button, and after that by clicking second button all of the data will be shown reversely on second listbox"
here is my code so far:
private void button1_Click(object sender, EventArgs e)
{
string[] n = new string[listBox1.Items.Add(textBox1.Text)];
for ( int i = 0; i < n.Length; i++)
{
n[i] = listBox1.Items[i].ToString();
}
}
private void button2_Click(object sender, EventArgs e)
{
string n = n.Reverse<>;
for(int i = 0; i < n.Length; i++)
{
listBox2.Items[i].ToString();
}
listBox1.Items.Clear();
}
----------
First button works perfectly however the reversing the array and show it in listbox2 is somehow not working,
Thanks in advance.
Reply
Answers (
5
)
login location-wise in application
Socket Programming in C#