Output an array in a textbox

This is a discussion on Output an array in a textbox within the C# Programming forums, part of the General Programming Boards category; Im working in the application GUI layout and was wandering if there was a scrollbox or something like that that ...

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    33

    Output an array in a textbox

    Im working in the application GUI layout and was wandering if there was a scrollbox or something like that that would allow me to output several arrays in it...

    For example, user inputs something, program calculates, and should output 12 arrays. How would I make the program output it into a specific box/something...

    I know for a label, you can have the program output a line of something, but im not too sure if it would output multiple lines/arrays as there wouldn't be enough room...

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,812
    Use a read-only text field or something similar.

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    33
    would the text field expand for me as the arrays make a new line each time? or do I have to make it large enough to fit all of them?

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,812
    You can give a text box the ability to have scrollbars. So it will expand in that fashion, if you so wish. You could also make it re sizable etc based on the text you are outputting, but that would be a little more difficult to code.

  5. #5
    Registered User
    Join Date
    Aug 2007
    Posts
    33
    hmm, ill check it out...

  6. #6
    Registered User
    Join Date
    Oct 2007
    Posts
    3
    Just have a normal textbox that supports multilines.

    Code:
    textBox1.MultiLine = true;
    
    foreach(string str in StringArray) textBox1.Text += str + System.Environment.NewLine;
    If the number of strings vertically exceeds the height of the textbox, scrollbars are added automaticly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. array output
    By aama100 in forum C++ Programming
    Replies: 5
    Last Post: 01-29-2008, 04:32 AM
  2. output an array to curses, or to another window?
    By trev456 in forum C++ Programming
    Replies: 2
    Last Post: 04-18-2007, 11:08 AM
  3. Outputing an array to a textbox ?
    By C of Green in forum C# Programming
    Replies: 2
    Last Post: 10-31-2006, 11:28 AM
  4. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 01:04 PM
  5. Creating 2D arrays on heap
    By sundeeptuteja in forum C++ Programming
    Replies: 6
    Last Post: 08-16-2002, 12:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21