Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




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




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Selecting Multiple Items From List View With Multilple Select Enabled
Hi,

I need to select a list of items/rows from a multiple select listview.

I am not sure how to proceed with this.

thanks

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?

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.

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

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

How To Select Multiple Columns With Column Number
i am currently using

Code:
sheet1.columns(5).select
and it works fine ...
however, lets say i want to select columns 5 - 10, i can't fingure out how to do this without converting the column number to a letter first.. can anyone help ... thanks

- VB AND EXCEL - Select Multiple Columns And Rows
Hello All,

I need to merge b5 to d5, e5:g5 (in excel-when in the process of crystal reports) in loop. i.e I want to merge every 3 colums in my excel starting "B" Column.


Code:
Do While Not rcl.EOF
startcolnoclient = 2 '' i.e 'B' column
xl.Application.Range(5, startcolnoclient & ":" & 5, startcolnoclient + 2).Select
- wrong code!!!!!!!
xl.Application.Selection.Merge
startcolnoclient = startcolnoclient + 3
rcl.MoveNext
Loop


Can you help me how to select multiple cells in number mode. I know how to select in alphabet mode(xl.Application.Range("b2:E5").Select).

Thanks

Multiple Columns List
In Access, you can make multiples-columns ComboBox.

For example, you can determine the ComboBox content by a sql query. Then, if this query return 3 fields, you can set the Columns property to 3 and the ComboBox display the 3 data for each row.

I want to do the same thing with Visual Basic: filling a ComboBox with data from an Access database.
But is it possible get more than 1 column in the ComboBox?

Multiple Columns In List Boxes
This may sound a bit lame but i just can't seem to figure it out.

I have a list box, two text boxes and a command button.
I want to input two numbers into the text boxes and then press the command button to put the first textbox into a column and then put the second text box into the second column.

Each time i put more data into the text boxes i want it to place the data in the same two columns but below the previous data.

Thanks...

Displaying Multiple Columns In A List Box
Hello everyone, I am trying to create a program for my family to use in tracking the kids' chore money. What I need to do is to be able to display the transactions from an account showing 5 different columns. I would like to display column headers also but I think for that I just need to load the headers as the first row in the list. I am trying to use a list box for this but if anyone has a better idea please let me know. Thanks, as always, for any help given and Happy Easter to all.


Cliff R.
Mesa, AZ
Check out my website at http://crogers.org
Being an organ donor is giving the greatest gift that someone can give.
It is giving the gift of life. Please register to be an organ donor.

Full Row Select Of List View
Hi,
How can I force full row select of a list view?

I know listviews come with a property called "FullRowSelect" but it is not available in my list view's properties.

How To Select Whole Row In List View Control
I have a list of records that selected from SQL server and I display it in list view. Now I need to select a whole row to view details. Does anyone know the code how to select the whole row in list view ? Thanks

List View Right Click Select
Hi
 im using a list view and i want it so when i right click on an item it selects the item right clicked upon.

How do you do this?

--------------------------------------------------
Should I apologize if what I say burns your
ears and stains your eyes?!

Multi Select Option In LIST VIEW...
Hi...
I had a listview box containg some items with check box option..
my problem is .."Even if i place multi select option to unchecked...Im able to check more that one item...:"
Even I tried the same with code also...
Please chk the code..

VB Code:
ListView1.MultiSelect = FalseListView1.ListItems.Add 1, "sd", "sdfsd"ListView1.ListItems.Add 2, "sd1", "sdfsd1"


finally ..my problem is "I want to restrict my users to select only one item at a time..."

Any immidiate help in this regard is gre8ly appriciated,,

thanx & regards
Anu..

List View Control - Select Subitems
hi all!

I have problems selecting the subitems in my listviewcontrol(Active X). I am using the code below for it:

--------- Searchtxt_TextChanged Event-----

FindData(Searchtxt.Text) 'Get the value for Found
With AxListView1
.HideSelection = False
.FindItem(Found).Selected = True ' Error
.SelectedItem.EnsureVisible()
End With

I always get an error whith "Value "0" was found but an objectinstanz was expected"; note that it works for the items.
The FindData Function:

Private Function FindData(ByVal Search As String)
Dim MyStr As String

For i = 1 To AxListView1.ListItems.Count - 1
MyStr = AxListView1.ListItems(i).Text ' Items
MyStr = AxListView1.ListItems(i).SubItems(1) ' Subitems
If InStr(1, MyStr, Search, CompareMethod.Binary) > 0 Then
Found = MyStr
Exit For
End If
Next
End Function

I would be very thankful if you could give me a hint to solve my problem ^^

with regards



Edited by - Birdy on 1/28/2002 4:20:05 AM

Make It Possible To Select An Entire Row In A List View? [Fixed]
hey ya,

I have a list view control on my form.

any when the user wants to select a "Record" held within it,

they can only click on the first column to select it.

BUT: i want it possible to select the entire row

Instead of just the first column.

is this possible?

[Kinda like how you select a row in the list control]

Thanks Guys

List View ? Mult-select Listitems Programatically
front end VB6 sp6
back end Sql7

How can i mult-select listitems in a listview in code (ie not involving the mouse)?
i have already selected the multi-select property for the listview.

the user enters a value into a textbox (ex 1-4). this tells me that they want listitems 1-4 selected , so i then call a sub that sets the selected property of those listitems to true but i cant seem to figure out how to keep the listitems higjlighted. below is the sub that should accomplish this. any help on this would greatly appreciated

Code:

Public Sub SelectItems(ByVal intStart As Integer, _
                       ByVal intFinish As Integer)
  Dim x As Integer
  'user only wants one item selected
  If intFinish = 0 Then
    lvwVouchers.ListItems(intStart).Selected = True
    Exit Sub
  End If
  'user has multiple items to select
  For x = intStart To intFinish
    lvwVouchers.ListItems(x).Selected = True
    lvwVouchers.ListItems(x).Checked = True
  Next x
  
  lvwVouchers.ListItems(intFinish).EnsureVisible
End Sub




 



Edited by - wizo on 10/18/2004 5:11:39 AM

List View Multiple Data
i am making a form that saves the data to a access database it has a text box for product name then a list box that contains 4 columns and can have multiple rows now i want to save all of those rows with that particular product name and also retain them when required
please help its urgent
regards

Retrieving Multiple Rows From A List View
Hi all;

I have been trying to create a function that returns values from a list view when the user selects more than one row. I figure a 2 dimensional array can do the trick, but the problem is I have not found a way to get the number of rows selected by the user. Does anyone out there know how to do this?

How To Select Multiple Items From A List Box To Another?
Hi guys..

I'd like to know how to select multiple items from a main list box to another list box? I've enabled the select extended on the main list box? Also, how do i remove multiple?
Currently, I can only move one item at a time.

Thanks!!

Regards
Vivien

Select Multiple Items In List Box
hi i got a listbox property , and i want it when i run the program , i can select multiple item in that listbox, however its wrong because it said cannot assign to read only property, --> listbox.multiselect = true is there anything code wrong? do you have solution how to fix this error so i can select multiple items in list box

thanks

How To Select Multiple Items In A List Box
suppose i have a list box. now after selecting multiple items by pressing ctrl button and the items , now i want to store these values in array of strings, then i have to display those values using array. is it possible .pls help me.
thank you.

For Statements With Multiple Select List Boxes
I wrote an app in VB.NET a while back where I was using checked list boxes and I needed to perform an action for each item that was selected. The below code was used:


VB Code:
For Each strDriver In lbDriversVer2.CheckedItems


I now need to do the same thing in VB6 with a list box.

However I attempted:


VB Code:
For each strData in list1.selected


and it comes back as Argument Not Optional.

Can anyone enlighten me as to what is involved in performing an action for each item that is selected in a multiple select list box?

Thanks,

Jim

How To Select Multiple Items In A List Box Concurrently ?
Good day !

Let say I have a list box contains the following elements :

10
10
10
20
30
40
50
50

How can I program the code, to make it select all the items with 10 automatically when I click on any one of the element with 10 ?

I spend whole day thinking of it, but still cannot find any solution.

Help !

Thanks a lot !

SonicWave

How To Select Items In Multiple List Box Concurrently ?
Good day !

I just have a small problem here.

Let say I have 2 List Box in a form, each contain the same amount of items.

If I select an item in List Box #1 , how can I make it automatically select thehe item in the same row in List Box #2 ?

Is there any built-in properties that I can use ? or I have to program it manually ?

Thanks a lot !

Sonic Wave

Access VBA Scripting And Multiple Select List Box And Email
Hello,

Below is some underlying code for an Access database that is to allow a
user to select multiple names from a list box and the names that they
select will be populated into the To: in Microsoft Outlook email.
However, with the current code, the email is created and even if I
select multiple email addresses only the first name is populated, even
if I have not selected that name. So somewhere nIndex is incorrect. I
see that I have nIndex set to 0 which would initially be the first email
address (like a default value) within the list. But how do I get this
to recognize all the other values that have been selected and display
them in the To field for the email?? I am not well versed in VB or VBA just yet, and am trying to get the hang, can you please help!
Thanks in advance,

Dim Outlook2000 As Outlook.Application
Dim DocketEventMail As MailItem
Dim nIndex As Long
Dim sAddr As String
Dim sBody As String

Set Outlook2000 = Outlook.Application
Set DocketEventMail = Outlook2000.CreateItem(olMailItem)

For nIndex = 0 To lstAddr.ListCount - 1
If lstAddr.Selected(nIndex) Then
sAddr = sAddr & lstAddr.ItemData(nIndex) & ";"
End If
Next

DocketEventMail.To = sAddr
DocketEventMail.Subject = "This is a test message"
DocketEventMail.Body = "Isn't this cool? Please let me know if you
received a reminder!"

DocketEventMail.ReminderSet = True
DocketEventMail.Display

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

Autofilter With Multiple Columns And Multiple Criteria
Hi

I have a sheet of data, which I need to clear up. What I want to do is use the autofilter function to filter out the information that I need, leaving what I don't need visible and then delete the visible rows.

First filter is on column D, where I need to select all rows that are in "Unit1" and then filter on column C to select all rows that are NOT "Team1" or "Team2".

Code I have is:

vb/
Dim CheckRange As Range, DeleteRange As Range

Set CheckRange = Worksheets("Sheet1").Columns(7)
CheckRange.AutoFilter Field:=4, Criteria1:="Unit1"
CheckRange.AutoFilter Field:=3, Criteria1:="<>Team1", Operator:=xlOr, Criteria2:="<>Team2"

Set DeleteRange = CheckRange.SpecialCells(xlCellTypeVisible).EntireRow
DeleteRange.Delete
/vb

However this does not work. It filters out all the non "Unit1" rows fine, but then applied a filter to Column C that does nothing!

Can someone help put me out of my misery?

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

How Can I View The Data From A Table In List View?
Please let me know how can I view the data from a table in List View?

How Can I View The Data From Table In List View?
Please let me know how can I view the data from a table in List View?

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 --

*SOLVED* Why Does 'Columns("E:E").Select' Select Entire Worksheet
Any ideas why when I execute the following code (created by first recording a macro) that it selects the entire worsheet instead of just the column I want?

Code:Columns("E:E").Select



Edited by - Patrick Gorman on 2/27/2006 6:33:40 PM

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,

Activex Controls For List Box, List View & Combo Box (for Storing Arabic Language)
Hi all,

Can any one having controls (list box, list view , combo & date
picker ) with right alignment. i.e scroll bar should come in left side
instead of right...simalry drop down for combo box should be in left side
instead of right side.

This i need for storing Arabic data...

Thnaks
Sridhar CS

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

Editing List Items And ListSubItems In List View Control
Hi,

It is possible to edit ( add an entry ) the first column of a ListView control. By setting to automatic mode.

How do I edit the subsequent columns ( The listSubItems ).

BB

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

 

Copyright © 2005-08 www.BigResource.com, All rights reserved