Click here to Skip to main content
13,090,178 members (49,427 online)
Rate this:
Please Sign up or sign in to vote.
See more:
i have a file which have content like this
a ,b,
c ,d,
e ,f,
g ,h,

now i have added a c e and g to the combobox after reading file by streamreader and then split the string. Now when i select a in combobox corresponding b value should be displayed on textbox likewise if i click on g h shuld be displayed on textbox.
Posted 4-Dec-12 1:31am
Krunal Rohit 4-Dec-12 7:39am
Have you tried anything so far ??
hiphopper0123 4-Dec-12 7:43am
yes but i am getting output b if i select a
but i select c e or h it didnt display output
my coding is
if (i == ind)
textBox1.Text = split[i + 1];
where ind is index position of selected item and i am adding index by i in split array so i get b but for other index position get changed

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

got the answer myself thnk you by the way

// MessageBox.Show(i.ToString());
            int count = 0;
            int splitcount = split.Length / 2;
            for (int i = 0; i < split.Length; i++)
                    if (i == ind)
                        textBox1.Text = split[i + 1*count];

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 4 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100