Click to See Complete Forum and Search --> : Label Box Question......Must See
Derek
February 24th, 2000, 02:58 AM
Hi,
How do i show items in a label box in a particular format? For Eg: Suppose i have to show items in a column and row format on a label when the items to be displayed are not permanant as they are coming from a database.
thanks in advance,
Derek
PS: By the way i am using a treview control so when a particular node has the focus it will display all the items that come under that particular selected item from the database.
Cakkie
February 24th, 2000, 03:28 AM
Placing them in 1 column isn't so hard, for more columns I don't have a solution (yet). U can use the vbCrlf to start a new line in a label, like this
label1.caption = "line1" & vbcrlf & "line2" & vbcrlf & "line3"
wich results in the label looking like this:
line1
line2
line3
For more columns you might try to add a tab between them, but I don't know if that's goint to work. Whitespaces are another solution, but only when you use a monospace font (a font where all the characters have the same width). But most fonts are not(like this i will be smaller than this m). If you do use a monospace font, be sure to include it with your installation file, because if you don't, and the user hasn't got that font, it will look screwed up.
Tom Cannaerts
slisse@planetinternet.be
The best way to escape a problem, is to solve it.
Ravi Kiran
February 24th, 2000, 03:46 AM
You can use vbCrlf and vbtab to allign the items in lines and colums.
With tab ofcourse, you have to have an idea as to what is the Max widths of all the elements in that column. Otherwise, it will go into next column, which will look bad!.
Better than that would be a listview with no
headers, and flat border sytle, etc to make it look as lean as possible.
check it out!
RK
Ravi Kiran
February 24th, 2000, 04:31 AM
hI
I am sorry for the wrong response. I posted it w/o testing.
vbTab cannot be used for column seperation. sorry
May be you could try my other suggestion!
RK
Derek
February 24th, 2000, 05:19 AM
Thanks for your help,
Derek
Cakkie
February 24th, 2000, 05:20 AM
I just got another idea, for each column, add a label. The probably is a better way, but hey, it works.
Tom Cannaerts
slisse@planetinternet.be
The best way to escape a problem, is to solve it.
February 24th, 2000, 10:14 AM
Hi,
It's me Derek. thanks alot Cakkie for the idea, but i need the fieldname and the data to be displayed from the database.
thanks alot for the idea again,
Derek
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.