Beginner VB

Moderators: None (Apply to moderate this forum)
Number of threads: 1244
Number of posts: 2990

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to add results to listbox Posted by Fidz on 17 Jun 2002 at 4:01 AM
Hi
I am not too sure about the code to add results that are calculated to the listbox...This program will convert from eg inches to centimeters and the results will be diplayed in the respective colunm heading...The colunm heading will come from the cbobox...Talking about column headings please can someone also help me out on how I could get the column heading on too...Thanks
Report
Re: How to add results to listbox Posted by ColdShine on 22 Jun 2002 at 2:16 PM
You would probably want to use a ListView control, as it incorporates column headers management. It's no more difficult to program than a ListBox control.
Hope this helps.
_____________________________
ColdShine
http://www16.brinkster.com/rafonline


Report
Re: How to add results to listbox Posted by KDivad Leahcim on 24 Jun 2002 at 1:02 PM
: You would probably want to use a ListView control, as it incorporates column headers management. It's no more difficult to program than a ListBox control.
: Hope this helps.
: _____________________________
: ColdShine
: http://www16.brinkster.com/rafonline

:
:

If it's that easy, then I'd like to make a quick request. How do you use the listview control? I've tried a few times, but never gotten very far. Basically, I want something that looks and acts like a listbox, but has multiple columns. With the right number of characters, the tab character works fine to make several columns, but that just doesn't work for me. I had given up and made my own listbox, but it is sorely lacking in useability...
Report
Re: How to add results to listbox Posted by ColdShine on 25 Jun 2002 at 6:51 AM
: How do you use the listview control?
Could be entirely different from what you need... <grin>

: I want something that looks and acts like a listbox, but has multiple columns.
ListView with FullRowSelect = True, HideColumnHeaders = True, View = lvwReport. In design mode, create the columns you need (they won't show, but you must specify their widths and text alignments), and in run time add the Items and SubItems you want.

: With the right number of characters, the tab character works fine to make several columns, but that just doesn't work for me.
The ListView will make you forget the tab ASCII code, and even the meaning of the word "tab"...

: I had given up and made my own listbox, but it is sorely lacking in useability...
I think the ListView and TreeView are the most complex pieces of software existing in the Windows world.
_____________________________
ColdShine
http://www16.brinkster.com/rafonline


Report
Re: How to add results to listbox Posted by KDivad Leahcim on 26 Jun 2002 at 4:59 AM
: : How do you use the listview control?
: Could be entirely different from what you need... <grin>
:
: : I want something that looks and acts like a listbox, but has multiple columns.
: ListView with FullRowSelect = True, HideColumnHeaders = True, View = lvwReport. In design mode, create the columns you need (they won't show, but you must specify their widths and text alignments), and in run time add the Items and SubItems you want.
:
: : With the right number of characters, the tab character works fine to make several columns, but that just doesn't work for me.
: The ListView will make you forget the tab ASCII code, and even the meaning of the word "tab"...
:
: : I had given up and made my own listbox, but it is sorely lacking in useability...
: I think the ListView and TreeView are the most complex pieces of software existing in the Windows world.
: _____________________________
: ColdShine
: http://www16.brinkster.com/rafonline

:
:

AHHHHH!!!! I figured it out finally. People keep telling me to use FullRowSelect, but it doesn't have it! v5 doesn't, v6 does but I don't normally have v6.

Last questions (some of which I could figure out if no one was helping me...):
How do I add, remove, etc. items? Can they be moved or do I need to remove and re-add in the new spot? Does it have an itemdata property or can I make a hidden column?

I think that's all...for now, at least. <grin>
Report
Re: How to add results to listbox Posted by ColdShine on 27 Jun 2002 at 11:19 AM
: Can they be moved or do I need to remove and re-add in the new spot?
Same as ListBox...

: Does it have an itemdata property or can I make a hidden column?
Every ListItem has a Tag (Variant) property. Do with it as you will.
_____________________________
ColdShine
http://www20.brinkster.com/coldshine


Report
Re: How to add results to listbox Posted by KDivad Leahcim on 26 Jun 2002 at 6:23 AM
: : How do you use the listview control?
: Could be entirely different from what you need... <grin>
:
: : I want something that looks and acts like a listbox, but has multiple columns.
: ListView with FullRowSelect = True, HideColumnHeaders = True, View = lvwReport. In design mode, create the columns you need (they won't show, but you must specify their widths and text alignments), and in run time add the Items and SubItems you want.
:
: : With the right number of characters, the tab character works fine to make several columns, but that just doesn't work for me.
: The ListView will make you forget the tab ASCII code, and even the meaning of the word "tab"...
:
: : I had given up and made my own listbox, but it is sorely lacking in useability...
: I think the ListView and TreeView are the most complex pieces of software existing in the Windows world.
: _____________________________
: ColdShine
: http://www16.brinkster.com/rafonline

:
:

I think I've figured part of it out, though it seems a bit clumsy. This is what I have so far:
    Dim t As ListItem
    Set t = ListView1.ListItems.Add(, , "C1")
    t.ListSubItems.Add , , "C2"
    t.ListSubItems.Add , , "C3"

A bit more and I may have it all worked out.

I assume I'll have to remove and re-add to move an item?

Is a column width of 0 the only way to hide one?
Report
Re: How to add results to listbox Posted by ColdShine on 27 Jun 2002 at 11:22 AM
: I assume I'll have to remove and re-add to move an item?
You've got it.

: Is a column width of 0 the only way to hide one?
Yes, it is. But keep in mind your final user will be able to track and resize the column header, thus revealing any data in the column.
_____________________________
ColdShine
http://www20.brinkster.com/coldshine


Report
Re: How to add results to listbox Posted by KDivad Leahcim on 28 Jun 2002 at 5:05 AM
: Yes, it is. But keep in mind your final user will be able to track and resize the column header, thus revealing any data in the column.
: _____________________________
: ColdShine
: http://www20.brinkster.com/coldshine


Nah, no header, remember? Even if they do see what's in the column, it's not a big deal. Each item is related to a file and the hidden column is simply the name of the file.

Thanks a million!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.