Listview Columns In List View
I am trying to use Listview to import data from an Access table and I only want to use the list view not the list report. The data imports OK and populates the list OK into (in this case with the quantity of data imported) 4 columns.
Trouble is, all the data is truncated and I can find no way of setting the column widths as you can in the normal list box. I do not have any sub-items, just a single list so I do not need to set up any column headers.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
2 Columns In List View:
i ahve a list view box, when i click the add button, i need to be able to add:
add.text in the first column
desc.text in the second column
but i can only get add.text in the first column.......
Ordering Columns In A List View
I know I can use the ascending and descending properties to order the first column in a list view, but how can I order the other columns as well?
Moving Columns On A Listview (Report View)
I want to programmatically set the Position of the columns in a list view.
This is an "after thought" so I am trying to do it on already loaded listviews.
I see from a little experimentation that I can easily move the column headers by simply changing the .position property.
But that does not bring over the data for that column. (Just the header)
Do I have to manually move the data or there an easier way?
(By "manually move the data" I mean set up a temp array, copy the column's data, update new column after moving other column into original col number)
Regards,
List View Select - Multiple Columns
I have a listview control with two columns...
1. File Name
2. Extension
When I selected the file I return the file name, but if i want to retrieve the properties regarding the file i need the extension which is in column 2...
This will get the information in column 1 (File Name)
Set objFile = objFSO.GetFile(DirList.List(DirList.ListIndex) & "" & lstFileList.SelectedItem.Text)
How do I get it so that it gets the info in column 1 and adds the info of column 2 to that string? i.e.
file name extension
mydoc doc
myvideo avi
myemail eml
i want it so that when i click on mydoc the string becomes... mydoc.doc, any ideas? thanks
- gabe
How Do I Hide/unhide Columns In A List View?
I want the user to choose the columns for a specified output though all the columns will be filled
with data , i want to display only those columns which the user selects.Currently i make the width
of the hidden column as - 0 but that the user can just keep his mouse on the header and drag to
see the hidden column. How do I actually hide it???
Sorting On DATE Columns In MS List View
Does anybody know how to get this to work?
The listview seems only capable of accepting strings as it's items so dates have to be converted to text and therefore are sorted as text.
How can I get around this?
Freeze The Columns Of List View Control
Hi Gurus,
I want to freeze the columns of a Listview control in Report view mode. Is there any property of List View or any other code example to show me how to prevent the columns to be resized by the user?
Help me plz, it is really necessary.
Waqas...
List View Find Text By Corrosponding Columns
Hi, i have a list view with 2 coumns and it retrieve information from a server and it contains different amounts of information at once.
What i need to do is locate in the first column of the listview anything containing
the index "hostname" then go retrieve the hostname which would be in the next column in the exact row. So it looks like this
Column 1 - Column 2
=====================
ip add - 192.168.blahblah
hostname - TheTestName
i want to retrieve "TheTestName" by finding the column "hostname" but i have no ideas how to achieve this. If anyone could help me out that would be great.
2 Qs : Timer And How Do I Hide/unhide Columns In A List View?
hi,
2 questions
For a listview, I want the user to choose the columns for a specified output though all the columns will be filled with data , i want to display only those columns which the user selects(Like we have it in windows explorer). Currently I make the width of the hidden column as - 0 but that the user can just keep his mouse on the header and drag to see the hidden column. How do I actually hide it???
Second question:
I have just recently find out that one cannot set the interval time of a timer for than 65000 millisecs that is apporx a minute. How do I set the interval of a timer for more than a minute say 3 minutes?
Thanks.
How To Sort Columns In List View -- Just Like Windows Explorer
Hi,
I am using ListView Control.. I want to sort the listview on a particular column when user selects it. Is there any direct way of doing this.. And can I set colors to rows in a Listview control.. Like I have a situation where I want alternate colours to be displayed.. Is it possible
Regards
Surya Prakash
* UNRESOLVED* Listview In 'list' View Problem.
I have a listview that can populate in either 'details' or 'list' view modes. It populates fine in 'details' view. However, in 'list' view mode, the listitems are not wide enough to see all the text. If I select 'details' then go back to 'view' it's ok.
'List' view on initial population
How it should look on initial population
Any help much appreciated!
Thanks
---------------------------------------------
http://members.lycos.co.uk/sjrseh/
Copy Listview Items To Another List View
Is there a quick way I can copy a list view item to another identical list view (ie having the same columns) without having to copy all the individual components separately. ie. the foreground colour, the icon, the sub items etc.
So basically something like:
set itmTo=lsvTo.ListItems.Add()
itmTo=lsvFrom.ListItems(nFrom)
The above code only copies the .Text property, not all properties.
Resizing Columns In One Listview To Automatically Resize Corresponding Columns In Another.
I'm currently building the front end to a VB6 application. This app is largely based on entering data into a Listview. In order facilitate data entry, I need to create an editable row beneath the listview, comprising of text boxes(unless there is a better method) and an "add" button. The problem is that when a column in the Listview is moved or resized, the array of textboxes need to reflect this change of order/size, as each textbox needs to appear beneath its corresponding column. Also, if the listview contains a large number of columns, and therefore a horizontal scrollbar, the textboxes will need to scroll also... I would be very grateful for any help..! Thanks...
Visual Basic List View Control To View Network Computers
Hi,
I am working on simple network connect utility and ready with the functinality. But I am stuck at a very important aspect of the GUI where I need a List View Control that will view the computers from the available LAN domains. And will let us select a particular computer on expanding the domain List Item. If not a list view then a treeview rather.
Also will this control let me select a NETWORK COMPUTER ONLY but not shared folders on its individual drives. Only computers has to be selected. Not the nodes (folders) shared at them.
Thanks.
Vinitsankhe.
Windows File Explorer.. Icon View And List View.
I'm trying to duplicate a function of the explorer.. The folder contents view.
See example of what I mean...
http://www.ibarn.net/fun/files/thumblist.jpg
I can do everything I need using the filelistbox with the sole exception of changing the display style. I don't want a file list, I want a list-view or icon-view. (Preferably both, with the option to switch between them.)
So my question to you fine people is...... what API or component could I find this capacity in? I've looked at all of the components and didn't see anything that looked close, and a search on the subject yeilds hundreds of people trying to emulate the "filemanager" explorer style, but none trying to kick out a normal, boring icon view like this.
Any help would be greatly appreciated.
Thanks.
List View PopUp Prob (lvwIcon View) *Resolved*
Hi all,
I have a listview in large icon view (lvwIcon). I have a popup menu displaying some options when the user right clicks an item that is specific for that item.
My question is this -
I want a different popup menu to show when the user right-clicks on a blank area of the listview which would display general options.
In my testing, whenever a blank area is clicked, the selected item is the first item (if none had been selected) or the current selected item (if one had already been selected).
I currently use the selecteditem.text to determine what pop up menu is to be used.
I guess in theory the code might be something like ;
Code:
If lvwMain.SelectedItem = Nothing then
PopupMenu mnuGeneral
Else
PopupMenu mnuSpecific
End If
Any help would be greatly appreciated.
Cheers
Jack
Adding Columns To A Listview That Already Has Columns
Hi
I'm new to VB6 (I usually program in VB.NET but have been asked to make an enhancement to a VB6 application).
I have a listview which has columns defined within it in the designer. The code I am looking at then retrieves data from a db and puts it into the listview.
I've been asked to add another column in the middle of the listview e.g. there are 10 columns defined in the designer and this new column needs to go at position 6. However, the data that needs to go in the new column needs to come from a different query than the one that fills the other columns. I therefore thought that the best way to do it was fill up the original columns and then slot in the new column and fill it from another query. I've been searching around but can't find any example of how to do this.
Please can anyone help, or suggest a better way to do it? Thanks!
Matching List View To Tree View
Hi Everyone,
Quick Question. I have a list view and a Tree view that are sharing the same data. The Tree view control lists all the Task Names and the List view control has the task detail. (Start, End Date and resources.)
The only issue is that the Line widths do not match. The Tree View nodes have more white space between them then the list view. Is there a way that I can match the width of the tree view rows to the rows on the List view?
Thanks
BDS
List View, Tree View Controls
I have had the same problem... I ended up righting my own controls so that it would run faster on the population of the control...
Sorry
Brooke
How To View The Datatypes Of Every Columns
Hi all
anyone here, knows how to view the data types, i'm using vb 6 front and oracle as back end.
What i want to do is this : Examples:
i have table EMP: columns= Fname,age,D_Date:
i want to view like this:
Column_name | DataTypes | Null
Fname | varchar2(30) | not null
Age | number(2) |
D_Date | Date |
Is this possible?
Removing Columns From Datasheet View
Hi all, please help!
I have a subform (in datasheet view) that has to show/hide different columns under different contexts.
I tried
mytextbox.visible = false
where mytextbox is a textbox in the subform. This hides the textbox in Form View, but doesn't do the trick in Datasheet View.
I also tried
mytextbox.ColumnHidden = true
This method hides the column in the datasheet, but the column is still in the datasheet. So the user can bring the hidden column back by resizing the column (dragging the column header).
It there any way to truely hide/delete/remove a column from a datasheet view???? I've looked everywhere on web, but in vein.
Any help would be greatly appreciated! Thanks in advance!!!
-- kothreat@yahoo.com --
Select Folder Dialog. List All Folders And Subfolder In List View
Hello all.
I am trying to select a folder in a folder dialog. I then want it to list all the folders and subfolders and files within the selected folder in the list view.
this is what i have so far. It just lists all the first children folders of the selected folder. any help on this?
Code:
Private Sub addFolders()
FolderBrowserDialog.ShowDialog()
ListView1.Items.Add(FolderBrowserDialog.SelectedPath) 'lists top selected folder
Dim STF As New IO.DirectoryInfo(FolderBrowserDialog.SelectedPath)
Dim F As IO.DirectoryInfo
'lists each folder inside top folder
For Each F In STF.GetDirectories()
ListView1.Items.Add(F.Name)
Next
End Sub
List Box - How To Have Left && Right Aligned Columns In The Same List Box.
Hi,
Excel 2000, VBA
Is it possible to have the different columns with left & right alignment in the same list box.
ie. columns 1 & 2, left aligned and column 3, right aligned.
One way I can think of is to place another list box over column 3 of the first list box, but it does make for fiddly coding.
I've googled, but not found anything. Any suggestions welcome.
Regards
What Is The Limits On COmbo Box, List Box And LIst View And How Do You Handle Situations W
OK<
I have looked at all 5 of my vb Barnes and noble books
under listbox
and did not find where it said what the limit was.
I learned how to read a data base (unbound even) into a list box, or combo box.
But now I have over 32,768 items,
my data base list has between 100,000 - 125,000 Parts I want to load.
I can think of a lot of cases where the data base you want to load into a list or combo box is well of 32768
So my questions are
( I did also search VBCITY)
1) What is the limits on
listbox
combo box
list view
and
where is it documented.
and 2
How do I handle the case of more than 32768 with a listview??
I did found a little bit about it on vbcity
Thanks
Changing To A List View Instead Of A List Box To Overcome 32768 Limits
I had the program done
I was loading a listbox and typing is a text box watching the closest match be selected.
I start off by filling the list box from a mdb with a table called partlist,
and a field called part numbers
It worked fine.
But now because I am over 32768 ( I will never go over 125,000) records, I am past the usefullness of a list box I guess.
so How do I change this code that works with a listbox, to code that works with a viewbox
and is this my best solution
Here is the listbox working code
Public Function FillListboxparts(Optional PartNumber As String)
Screen.MousePointer = vbHourglass
Dim li As ListItem
Dim lih As ListItem
Dim cnn As ADODB.Connection
Dim rsPartList As ADODB.Recordset
Dim strSQL As String
strSQL = "SELECT PartNumber From partlist"
Set cnn = New ADODB.Connection
cnn.Open ConnString
Set rsPartList = New ADODB.Recordset
rsPartList.Open strSQL, cnn
While Not rsPartList.EOF
listboxparts.AddItem rsPartList("Partnumber")
rsPartList.MoveNext
Wend
Text1.Text = listboxparts.ListCount
rsPartList.Close
Set rsPartList = Nothing
cnn.Close
Set cnn = Nothing
Set li = Nothing
Set lih = Nothing
Screen.MousePointer = vbDefault
End Function
Tree View + List View
Hai,
In my application, I have Tree view on left side and List view on the right side which is just like windows Explorer. I would like to get the same functionality like Explorer where you can move the seperator between Tree View and List View. That means I would like to make the List View wider or shorter as I wish.
Can any body help me?
Thanking you in anticipation
Selected List View Field To List Box
hi,
I Have list view control with check box, when i select the record the record to be displayed in list box,The event is geting trigered but the problem is that if i have multiselction or another row selection the exiting record disappears from the list box.
*RESOLVED* Getting Selected Item In List View To Move Into View*RESOLVED*
Hi, I am trying to get a List View to act like a combo box. At the top of the List View there is a text box where the following code searches the List View for the text entered, I have this code in the Change event of the text box so a search is done on each letter typed.
The code finds the record without a problem but I want it to move to the top or into view. Right now I have to scroll down to find the record it selected. Anyone have any ideas? Here is my code:
Code:
Private Sub txtFindFirst_Change()
Dim i As Integer
Dim l As Long
On Error GoTo NoRecord
If txtFindFirst = "" Then
GoTo NoRecord
Else
l = Len(txtFindFirst.Text)
For i = 1 To lstContacts.ListItems.Count Step 1
If StrConv(txtFindFirst, vbUpperCase) = StrConv(Left(lstContacts.ListItems(i).Text, l), vbUpperCase) Then
lstContacts.ListItems(i).Selected = True
Exit Sub
Else
End If
Next
End If
NoRecord:
On Error GoTo NoList
lstContacts.ListItems(1).Selected = True
strTransferID = lstContacts.SelectedItem.ListSubItems(1).Text
Exit Sub
NoList:
Exit Sub
End Sub
Thanks in advance for any help.
List View List Subitems Help
Hi guys,
Im generating a time based values which im adding to my listview (report style) under three columns before a new row is generated. Now i want to add another value to column 4 nly how do i do that??
i think it has something to do with:
Set listsubitem1 = listitem1.ListSubItems.Add() ????
but i want to add under column 4 continously??
help!
ListView Columns
How do i add columns to a ListView and also how do i insert information into a listview box? For my listview i require 3 columns: 'Artist', 'Track' and 'CD'.
I have tried adding columns using the properties dialog, but they don't appear when i run the form.
Any help is much appreciated!
James
Listview Columns
if I do lvwListView.listitems.additem ,, "test"
it adds an item in the first column of the listview
how do i add data in the second column of a listview
ListView Columns
I have four columns in a list view, each taking up 25% of the available space. When the form resizes, I am successfully resizing the ListView, but how do I resize each of the columns back to 25% of the new size.
I have tried ListView1.ColumnHeaders.Items(0).Width, but that results in a Out of Bounds Error. I have also tried with Items(1) with the same result.
Any idaes
Listview Columns
thought i would have a go using a listview in report mode.
i must be missing something and see what.
when i insert a column and give it a caption it will insert it but then i have 2 columns.
i wanted 3 columns altogether but it shows 4, always 1 more.
what am i missing ?
thanks
thingimijig.
ListView Columns
If I have 2 columns in a ListView (set to Report), how can I add data to them? I have tried for ages, and I cant figure it out.
Columns To A ListView
Is it possible to add Columns to a ListView manually or does it have to be done at runtime?
Two Columns In Listview
sorry, this may be a silly question but its very frustrating,
all i need is for my listview to display two columns of data, taken from a query currently i can achieve one column but i need to add another with "LastName" cheers, here is my code so far
Code:
Set cn = New ADODB.Connection 'we've declared it as a ADODB connection lets set it.
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= c:vdmcertymate VBdatadata.mdb" 'this is the connection string explained in the notes section.
cn.Open
Set rs = New ADODB.Recordset 'as we did with the connection
rs.Open "qryEmployees", cn, adOpenKeyset, adLockPessimistic, adCmdTable 'opening the recordset explained in the notes
'Code to populate the listView
While Not rs.EOF
lstvEmployees.ListItems.Add , , rs.Fields("FirstName").Value
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Me.MousePointer = 0 'Resets Mouse Pointer
oh. and how do i get the listview to add a verticle scrollbar?
Listview Columns
this is a quick question really can u parse a site out into a listview with columns for different info from the site?
its a bit tricky to explain and show you as i want to connect to a site in inet grab the source parse out some hardware information,how many on the site, and how many on order and the price into one listview nicely 'ordered with column headers..
i can connect and parse the hardware info into the listview fine but i was wondering on how to do the other parts but because u need an account on the site i cant show u it however here is some of the info from the source (the parts ive gotten out and im needing to parse out..
HTML Code:
>10/100MBPs NIC</a></td><td align="right">4.96 £</td><td align="right"><div class="g">4</div></td><td align="right"><div class="b">2<
theres say part of the info from the source ive gotten the 10/100 "part" fine but i need to get the "4.96, class="g">4< amount and class="b">2< amount (which change obviously...
is this possible to parse into a listview with columns to save me having to go to the site each time and then get those parts of the info which really defeats the purpose of the program? or do i need to use a different control other than listview?
any help or tips would be great
Listview With Different Columns?
In Listview I want to create 5 columns each having column header as "S.No", "From", "Subject", "Date", "Time"
I created Column headers in design time but they are not getting displayed? Also I want that S.No column to be having Checkboxes. How to do that? Thanks.
Listview Columns
I can only select the index column out of my data when in a listview. Code and input follows: Also I cannot input files other than the one I used to test with, of the same format?! (Not the one attached)
Option Explicit
Private Sub Form_Load()
Dim K As Integer
Dim itmX As ListItem
Dim clmX As ColumnHeader
K = 1
Set clmX = ListView1.ColumnHeaders.Add(, , "Column 1", ListView1.Width / 5)
ListView1.BorderStyle = ccFixedSingle
ListView1.View = lvwReport
ListView1.ListItems.Clear
Dim FF As Integer
Dim strLine As String
FF = FreeFile
Open "C:sheet.csv" For Input As #FF
Do While Not EOF(FF)
Line Input #FF, strLine
AddListView strLine
Loop
Close #FF
End Sub
Private Sub AddListView(S As String)
Dim Ar() As String
Dim i As Integer
Ar = Split(S, ",")
If UBound(Ar) > ListView1.ColumnHeaders.Count Then
For i = ListView1.ColumnHeaders.Count To UBound(Ar)
Dim clmX As ColumnHeader
Set clmX = ListView1.ColumnHeaders.Add(, , "Column " & i + 9, ListView1.Width / 5)
Next
End If
Dim lv As ListItem
Set lv = ListView1.ListItems.Add(, , Ar(0))
For i = 1 To UBound(Ar)
lv.ListSubItems.Add , , Ar(i)
Next
End Sub
Private Sub SortListView(ByRef List As ListView, ColHeadIndex As Integer)
Dim lcv As Long 'Loop Control Variable
With List
' Make sure the Sorted property is set to true
.Sorted = True
' Sort according to the colum that was clicked (off by one)
.SortKey = ColHeadIndex - 1
' Does the column already have an icon?
If .ColumnHeaders(ColHeadIndex).Icon = 0 Then
'No, So we will assume this column is not sorted
' Set to Ascending order
.SortOrder = lvwAscending
' Set the sort order to descending
.SortOrder = lvwDescending
Else
' Otherwise sort into ascending order
' Set to Ascending order
.SortOrder = lvwAscending
End If
' Refresh the display of the ListView Control
.Refresh
End With
End Sub
Listview Columns
when using a listview in report mode, do you always have to have a blank list at the end.
when i add columns through its properties there is always another blank one, and if i try and size it to fit the size i want it either still shows a bit of the blank one or i get rid of it and a scrollbar appears.
any ideas!
thanks.
thingimijig.
ListView Columns
Sups,
I got a listview with two columns on it.
I forgot how to add item to each column.
How can I do that?
tnx.
ListView And Columns
How can I set the column width to be that of the text? I tried:
VB Code:
lstOutput.ColumnHeaders(1).Width = TextWidth(strText)
But that didn't work...
Any ideas?
ListView Columns
I have 5 columns in the ListView, all were added via code at runtime. Now, for example, I want to remove column with index 2, problem is, the data from the last column disappears and all the data gets shifted so column with index 3 will now have what column with index 2 had before removing. Is there an easy way to remove column and all the data in it (like Access 2000 does) or do I have to go item by item moving subitems from each column to previous one making 2 last columns identical in data but not column header text, then it should work, because last column will be removed anyway. Here's when another problem comes up, if I add a new column, the data from last column will become visible again, so I really didn't remove column completely, just the column header and made data in the last column invisible. Maybe when I'm adding columns, I need to specify a key or index or what not to remove it completely? I just want to remove the whole column (header and data in it) completely, and shift all the columns to the left; and when I add a new column, I want it to be "blank", meaning no data in it. Of course, it all can be done via long code. I have to set each item's subitem of the new added column to "", etc. but there should be an easier way!
Thanks
Listview Columns
I have a listview with three columns. I want to load a table of names into the listview, putting last names A-F in #1, G-S in #2, and T-Z in #3.
I know how to loop through the table and load the names, but I don't know the listview code to separate the names into columns. Any ideas?
|