Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 20th, 2006, 9:31 PM   #1
NightShade01
Programmer
 
Join Date: Oct 2005
Posts: 52
Rep Power: 3 NightShade01 is on a distinguished road
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))

        Next

the 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?
NightShade01 is offline   Reply With Quote
Old Aug 20th, 2006, 10:15 PM   #2
BlazingWolf
Hobbyist Programmer
 
Join Date: Sep 2004
Posts: 207
Rep Power: 5 BlazingWolf is on a distinguished road
txtconsole.AppendText(sFile(0) + "\r\n")

That should add a line break.
__________________
_______________________________
BlazingWolf
BlazingWolf is offline   Reply With Quote
Old Aug 20th, 2006, 10:18 PM   #3
NightShade01
Programmer
 
Join Date: Oct 2005
Posts: 52
Rep Power: 3 NightShade01 is on a distinguished road
thanks i actually found another way too

Dim ret As String = ControlChars.NewLine
txtconsole.AppendText(sFile(i) & ret)
NightShade01 is offline   Reply With Quote
Old Aug 21st, 2006, 3:59 AM   #4
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,033
Rep Power: 5 lectricpharaoh will become famous soon enough
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
lectricpharaoh is offline   Reply With Quote
Old Aug 21st, 2006, 11:08 AM   #5
randum77
Programmer
 
randum77's Avatar
 
Join Date: Jun 2006
Location: Fayettehell, NC
Posts: 56
Rep Power: 3 randum77 is on a distinguished road
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."
randum77 is offline   Reply With Quote
Old Aug 21st, 2006, 12:22 PM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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 10:15 PM
Problem using WM_GETICON coder0xff C++ 9 Jun 11th, 2006 7:01 PM
Problem Associated with Vector Source code buggytoast Java 3 Apr 2nd, 2006 5:41 AM
[Python] BlackJack UnKnown X Show Off Your Open Source Projects 9 Feb 20th, 2006 6:01 AM
function solomon_13000 Java 6 Apr 2nd, 2005 11:42 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:52 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC