|
-
May 12th, 2005, 01:42 AM
#1
Thread Starter
Hyperactive Member
List box line feed
G'day,
I am populating a list box with data from a database using this ...
VB Code:
List1.Item(X).AddItem .Fields!JobNumber _
& vbTab & .Fields!TimeAvailable _
& vbTab & Left(.Fields!Couriertype, 2) _
& vbCrLf _
& vbTab & FromRs.Fields!CName _
& vbTab & FromRs.Fields!AddrSuburb _
& vbTab & ToRs.Fields!CName _
& vbTab & ToRs.Fields!AddrSuburb _
& vbCrLf _
& vbTab & TempString
, but the vbCrLf doesn't work - it just gives me 2 vertical bars.
I know I can use AddItem several times to simulate the line feed, but that's no good to me as clicking on one item won't select all the tiems in the record.
Peter
My reputation is in tatters. Don't bother trying to repair it.
-
May 12th, 2005, 01:52 AM
#2
Re: List box line feed
Listboxes aren't designed for that purpose I think you'll find. They are designed to list one item on one line, that's why you see the two characters representing carriage return and line feed (ControlChars.CrLf).
Yey! My 1,400th post.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
May 12th, 2005, 01:53 AM
#3
Junior Member
Re: List box line feed
hi..tried to use the "controlchars.CrLf" instead of vbCrLf?
-
May 12th, 2005, 01:55 AM
#4
Re: List box line feed
ControlChars.CrLf and vbCrLf are the same thing, though the former is the more correct .NET way.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
May 12th, 2005, 01:57 AM
#5
Thread Starter
Hyperactive Member
Re: List box line feed
G'day Andy,
 Originally Posted by Andyc76
hi..tried to use the "controlchars.CrLf" instead of vbCrLf?
It says variable not defined.
Peter
My reputation is in tatters. Don't bother trying to repair it.
-
May 12th, 2005, 02:06 AM
#6
Re: List box line feed
Are you sure you're entering it in correctly? It shouldn't say that, unless you don't have the correct library referenced.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
May 12th, 2005, 02:18 AM
#7
Thread Starter
Hyperactive Member
Re: List box line feed
G'day,
 Originally Posted by Ideas Man
Are you sure you're entering it in correctly? It shouldn't say that, unless you don't have the correct library referenced.
Yes, I copy/pasted, but the missing library is a distinct possibility. Which resource do I need?
Peter
My reputation is in tatters. Don't bother trying to repair it.
-
May 12th, 2005, 02:29 AM
#8
Junior Member
Re: List box line feed
Hi..try to include "System"
(Imports System), or microsoft.Visualbasic..
-
May 12th, 2005, 02:33 AM
#9
Re: List box line feed
Microsoft.VisualBasic.ControlChars is the full path to the class.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
May 12th, 2005, 02:34 AM
#10
Thread Starter
Hyperactive Member
Re: List box line feed
G'day Andy,
 Originally Posted by Andyc76
Hi..try to include "System"
(Imports System), or microsoft.Visualbasic..
Sorry, you have lost me there. I'm running vb6 with sp6. What am I missing?
Peter
My reputation is in tatters. Don't bother trying to repair it.
-
May 12th, 2005, 02:39 AM
#11
Thread Starter
Hyperactive Member
Re: List box line feed
G'day,
Oops!!!!!!!
My error. I am in the wrong forum.
Peter
My reputation is in tatters. Don't bother trying to repair it.
-
May 12th, 2005, 02:40 AM
#12
Re: List box line feed
Why did you post in the Visual Basic .NET forum then? They are two semi-'different' languages. Could a moderator please move this into classic VB?
What we were both talking about was for .NET, not VB6.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
May 12th, 2005, 02:43 AM
#13
Thread Starter
Hyperactive Member
Re: List box line feed
G'day,
 Originally Posted by Ideas Man
Why did you post in the Visual Basic .NET forum then? They are two semi-'different' languages. Could a moderator please move this into classic VB?
What we were both talking about was for .NET, not VB6.
Is stupidity a valid excuse?
I'll go to the right forum and repost.
Thanks for your efforts.
Peter
My reputation is in tatters. Don't bother trying to repair it.
-
May 12th, 2005, 02:45 AM
#14
Re: List box line feed
Or better yet, just wait for a mod to move it, that way it stays intact.
If you are going to post it in another form, please say something like that in the title for the first message to let people browsing know that.
Yeah, I'll forgive a fellow aussie for posting it in the wrong form
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
May 12th, 2005, 02:50 AM
#15
Junior Member
Re: List box line feed
 Originally Posted by Supremus
G'day,
Oops!!!!!!!
My error. I am in the wrong forum.
Peter
LOL.. No problem..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|