![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 52
Rep Power: 4
![]() |
return key
Hey all quick question. I want to display all the file names of all the files within a directory. so i wrote a click_button function that does the following:
Dim sFile() As String = Directory.GetFiles("C:\test", "*.txt")
Dim i As Integer
For i = 0 To sFile.GetUpperBound(0)
txtconsole.AppendText(sFile(0))
Nextthe problem is that it just displays my text in a text box one after the other. I want it to output the file name, go to the next line and then out the next file name. I can't seem to find how to get the cursor to "return" b4 outputting the next file name. Any ideas? |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Sep 2004
Posts: 207
Rep Power: 5
![]() |
txtconsole.AppendText(sFile(0) + "\r\n")
That should add a line break.
__________________
_______________________________ BlazingWolf |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Oct 2005
Posts: 52
Rep Power: 4
![]() |
thanks i actually found another way too
Dim ret As String = ControlChars.NewLine txtconsole.AppendText(sFile(i) & ret) |
|
|
|
|
|
#4 |
|
SEXY SHOELESS GOD OF WAR!
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,186
Rep Power: 5
![]() |
You can use VbCrLf, too; this is the carriage return/linefeed combination. There are some other predefined constants here that you might find interesting.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Jun 2006
Location: Fayettehell, NC
Posts: 56
Rep Power: 3
![]() |
I use the " ControlChars.NewLine() " when doing a new line after text.
__________________
_Marshall_ "America has bred a society that is innocent and incapable of accepting responsibility, but yet, is able to place blame on others without guilt." |
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Sounds familiar. Did you happen to see post #3?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 500 Ways to Program Numbers 1 Through 10! | Sane | Coder's Corner Lounge | 637 | Jan 5th, 2008 11:15 PM |
| Problem using WM_GETICON | coder0xff | C++ | 9 | Jun 11th, 2006 8:01 PM |
| Problem Associated with Vector Source code | buggytoast | Java | 3 | Apr 2nd, 2006 6:41 AM |
| [Python] BlackJack | UnKnown X | Show Off Your Open Source Projects | 9 | Feb 20th, 2006 7:01 AM |
| function | solomon_13000 | Java | 6 | Apr 3rd, 2005 12:42 AM |