Click here to Skip to main content
15,894,186 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
C#
static void Main(string[] args)
      {
        int i;
        int[] arr = new int[4]; // 4 size array

        
        for (i = 0; i<4; i++)
         {
           Console.Write("\nEnter your number:\t");
           //Storing value in an array
           arr[i] = Convert.ToInt32(Console.ReadLine());
         }

        Console.WriteLine("\n\n");
        //Printing the value on console
        for (i = 0; i<4; i++)
         {
           Console.WriteLine("you entered {0}", arr[i]);
         }
        Console.ReadLine();
      }



its in Console , i want know how is it in wpf
input from a textbox to an array
Posted
Updated 16-Dec-13 18:22pm
v3
Comments
CHill60 16-Dec-13 7:54am    
What do you want to do with the output? You have many options - e.g. a multi-line text box, a list box, a list view, etc etc etc. And how do you want to capture your input (insert list of options here). Use the Improve question link to add more detail to your question
[no name] 16-Dec-13 23:48pm    
i am beginner in c# wpf i , please tell these 3 type(multi-line text box, a list box, a list view) any other
[no name] 17-Dec-13 0:19am    
input from a textbox to an array
ridoy 16-Dec-13 9:23am    
Well, that is certainty not a question. It depends how you like to represent your array elements.It's all about a view, nothing else. Follow what CHill60 has told you here.

1 solution

the same way

for (int i = 0; i < n; i++)
{
answer[i] = Console.ReadLine();
}
 
Share this answer
 
Comments
CHill60 16-Dec-13 7:57am    
Based on his final line, I'm guessing that the OP wanted a gui presentation rather than console

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900