Another One With List View *SOLVED*
I am Sorry to bother you guys again with my problem, but it drives me nuts.
All right,
I have a Form containing three listviews.
If the User clicks a button, i need to know which listview has the selected Item.
I tryd this but it doesn`t work:
VB Code: If listview.SelectedItem.text <> "" ThenMsgBox listview.SelectedItem.textElseIf listview2.SelectedItem.text <> "" ThenMsgBox listview2.SelectedItem.textElseIf listview3.SelectedItem.text <> "" ThenMsgBox listview3.SelectedItem.textElseMsgBox "Please Choose an Entry"End If
Thanx in advance,
Stephan
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
List-View Error! **SOLVED**
OK folks, heres another one i cant figure out:
I have a form which contains three ListViews.
I used the gotFocus method to perform some action. Every thing works fine, while I have the ListViews filled with data.
But if my ListViews have no Data at all, the got focus method always creates an error:
Heres my sourcecode:
VB Code:
Private Sub lstview_GotFocus() On Error GoTo lstview_GotFocus_Err: focus = "lstview" ' focus is a Form variable lstview_GotFocus_Err: 'Critical Error giRC = CriticalMsgBox(Err.Number, Err.Description, Me.Name & "_lstview_GotFocus") ' this is a function which contains the actual msgbox End Sub
Does anyone know why this function runs into the error-clause?
Thanx in advance;
Stephan
List View! An Easy One! * Solved *
I am a little emberrased to even ask this question, but I just cant figure it out myselfe.
I have a ListView with a couple of entrys.
What I want to do is, that the User is not able to change the value of an entry, but still is able to select it!
VB Code:
lstmylist.FullRowSelect = Truelstmylist.Enabled = False ' this one is not correct
Please give me a hand on this one!
Thanx in advance
Stephan
List View - Shifting Values From Right To Left If Left Column Is Empty [SOLVED]
I'm having a problem with ListView... if I delete a field value from any record, the remaining values from the other fields to the right of the empty field will "shift" to the right to ocupy the empty field.. the last field in the Db will now show empty.... this just happens in List View not in the actual Access DB
This is part of the code I'm using to populate the ListView
Code:
Public Sub PopluateListView(SQL As String, Lv As ListView)
On Error Resume Next
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim i As Long
Dim j As Long
Dim k As Long
rs.Open SQL, cn, adOpenStatic, adLockOptimistic
frmFieldsView.Caption = "Viewing Table " & frmDBTView.TableView1.SelectedItem.Text
For i = 0 To rs.Fields.Count - 1
Lv.ColumnHeaders.Add , , rs.Fields(i).Name
Next i
frmDBTView.ProgressBar1.Max = rs.RecordCount
frmDBTView.ProgressBar1.Value = 0
Screen.MousePointer = vbHourglass
For k = 0 To rs.RecordCount
If IsNull(rs.Fields(0).Value) Then Lv.ListItems.Add , , "" Else Lv.ListItems.Add , , rs.Fields(0).Value
For j = 1 To rs.Fields.Count
If IsNull(rs.Fields(1).Value) Then Lv.ListItems.Item(k + 1).ListSubItems.Add , , "" Else Lv.ListItems.Item(k _
+ 1).ListSubItems.Add , , rs.Fields(j).Value
Next j
frmDBTView.ProgressBar1.Value = k
rs.MoveNext
Next k
frmFieldsView.StatusBar1.Panels(1).Text = "Record(s) " & rs.RecordCount
frmDBTView.ProgressBar1.Value = 0
Screen.MousePointer = vbArrow
rs.Close
Set rs = Nothing
End Sub
What am I doing wrong?
Thanks for any help
_________________________________________________________________
Edited by - vbprog1144 on 4/9/2005 11:19:53 AM
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
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
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
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
View Of Software Development Technic In Vb6 {SOLVED}
hi...i realised this is an "out of question" question...
im just revising on software developing technic on vb6...
just want u guys opininon whats the best methode on deloping a vb6 software....
as eg...the best technic on developing a web based technic like vb.net is UML...(unified modelling languange...)
so what is for structured based such vb6...
happy to hear from u guys...
______________________________________________
Me And MySelf->The world are richer than we thought...
----------------------------------------------------------------
Edited by - Shatred on 1/30/2005 2:34:27 PM
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.
*solved*I Wanna Learn ListView In Report View
hi this is a new thread after advice on moving from Picture1 to now i believe ListView in Report view is the way to go.
Metallisoft can you help me get his going. I have attached form1 to download and change as i can't get it to work. your reference click here hasnt helped me as it gave me 3 values i only need 2
Database eg
Quote:UNIVERSAL OEM MFG
16190 2-1428-HI WAI
16190 SJ-0001R AIM
16190 91-25-1030 WILSON
16190 S9024 LUCAS REMAN
16190 9821006350 ISUZU
16190 9821006060 ISUZU
16190 S114-136 HITACHI
16190 S114-100 HITACHI
16190 SR198X BOSCH REMAN
16190 94022494 GENERAL MOTORS
16190 RXS056 OEX
16190 94021044 GENERAL MOTORS
16190 S114-118 HITACHI I Don't need to display the UNIVERSAL Numbers Just OEM anf MFG only
Code:Private Sub Command3_Click()
Set rs = New ADODB.Recordset 'this will be the rs
Dim strSQL As String 'this the source
'make the selection string: filter the records right away
strSQL = "SELECT C.* FROM OEMS AS C where UNIVERSAL in(select UNIVERSAL from OEMS where oem='" & UCase$(Text1) & "')"
' To hold a reference to the current Listitem (row).
Dim oLVItem As MSComctlLib.ListItem
' The (Listview.Width - 350) / 3 simply adjusts the column
' widths to 1/3 the width of the Listview (subtracting the
' width of the scrollbar)
' ListView.ColumnHeaders.Add , , "Supplier", (ListView.Width - 350) / 3 '<- Don't need to work?
ListView.ColumnHeaders.Add , , "OEM", (ListView.Width - 350) / 3
ListView.ColumnHeaders.Add , , "Manufacturer", (ListView.Width - 350) / 3
Picture1.Cls
Picture1.FontSize = 8
Picture1.Font.Bold = True
Picture1.Print ">> Supplier Information"
Picture1.Font.Bold = False
Picture1.Print "OEM:"; Tab(20); "Manufacturer:"
rs.Open strSQL, oConnection, adOpenStatic, adLockOptimistic, adCmdText
'loop through the recordset
Do Until rs.EOF
M19 = rs("OEM") 'Are m19 and m20 properties or local variables? didn't want to take them out, but if they are global settings and there are more records, they will only 'remember' the values in the last record.(No they are strings in a database)
M20 = rs("MFG")
Picture1.Print M19; Tab(20); M20
rs.MoveNext
Loop
rs.Close 'Close the recordset never leave it open!
Set rs = Nothing 'clear the rs variable
End Sub
OK NOW how do i replace the Picture1 to ListView in Report view after reading MSDN click here CAN anyone save me? the ColumnHeaders don't display too?
Edited by - Hopeless on 6/4/2004 12:16:16 AM
[solved]A Standard Menu Bar (File, Edit, View, Ect)
How could I make one for vb 6?
I'm pretty sure there is one in .NET in the toolbox that you can just add and go, but I dont know if there even is one for vb6 and if there is, I can't find it. Help would be much appreciated. Thanks.
Edited by - Dieten on 3/24/2006 7:22:22 AM
[SOLVED] Tree View Control - Index Out Of Bound ERROR
When I run the Tree View control I'm getting a - Run time error 35600 Index Out of Bounds - when I choose some fields to view ... not with all. This is the part of the code where I get the error and don't know why..... I tried changing data type - no results.... I'm stuck.
Code:Private Sub mnuSelField_Click()
Call PopluateListView("Select " & TreeView1.SelectedItem.Text & " from [" & TableView1.SelectedItem.Text & "]", FrmView.ListView1)
FrmView.ListView1.ColumnHeaders.Item(1).Width = 5000 <This is where I get the error Width returns a value = 0
FrmView.Show
End Sub
I'm reading records from an Access 2002 Database - VB6
vbprog1144
Edited by - vbprog1144 on 2/14/2004 4:09:26 PM
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!
List View Help
I need to remove the horizontal scroll bar from my list view box.
I have tried to make the column smaller, how ever it cuts of the data stored with in.
Any ideas?
List View
Hai,
Is there any way to apply the Windows XP Visual style to the List View in Common Controlls 6 ?
List View
I have looked through the listview methods and I am unable to locate the relevant one to tell me all the items in the list. Anyone got any ideas what it is?
List View
Lets try this again.
I have a listview that I would like to beable to know where the selection bar is. so that I can set the list to match the bar.
Don
List View Help
i need some code that will say bring a msgbox up when a new entry comes up in the list view it needs to identify the new entry in the msg box
List View !!
Hi Folks
Can you help me with this one.
I have a list view set as a report. I also a have data control. As the form activate event triggers I want the data control to loop through it's recordset to populate list view. Which works ok.
The problem I am getting is when I make a change to the database.
From the form with the listview I can load another form which allows you to make a change to the database. Once you close this form down it triggers the activate event in the listview form hence repopulating the listview. The problem is the listview does not refelect the change I have just made. However, if a put a break in the code and follow it through line by line it works ?? Is there some sort of refresh problem here ??
Thanks
List View
I have a list view box with 4 colums how can I add things into colum number 2 - 4.
-Hao Li-
List View
Hi
I have some problem in list view control… I have also attached my control.. I want to pass a record set to list view control… and then trying to display the record set in the lsit view control..
But there are some problem which I m encountering…
· That if I tried to pass the recordset to list view it gives me a type mismatch error.
· And I cant figure out how to populate a record set in a list view….. that’s it the sub itme .. thingy is not working...
· I ma also unable to include a check box in start of every row.
· Can menu be added to an active x control. I have added the menu but they can be popup but not.. the main .. menu.. more over how can i add the key to a perticular record.. so that i can track which row is been clicked and then i decide what do to with that row or record
List View
I need to take every object in a list view one by one and pass them to be anaylised until there are no more options.
e.g.
I need to scan all of the entries for an entry that matches say "1" and keep scanning them untill there is no "1"
I am really not familiar with the list view object - can anyone help???
---
Thank-you
K Black
List View
This is my problem, I'm not sure if it fits in here, but I will post it anyways.
I need to loop through all rows in a list view to get the text from each row. Something like this:
For I = 1 To lvwPrereq.ListItems.Count
lvwPrereq.selecteditem.index = I 'WON'T WORK!
MsgBox lvwPrereq.SelectedItem.Text
Next I
But the problem is, I don't know what the property is that will allow me to do it.
I've tried the above, and of course it doesn't work. Does anyone know how this may be accomplished??
List View
Hello,
Im needing some help if possible.
I have managed to get the form load and the fuction to work for listview 1 but my problem shows on command1 code can anyone help please.
I want it to show listview2 with just the users with Userlevel Admin.
code Code:
Private Sub Command1_Click()
Connect2dB
With rst1
rst1.Open "select * from tblUsers where UserLevel = 'Admin'"
ListView2.ListItems.Clear
ListView2.Visible = True
ListView1.Visible = False
While rst.EOF = False
ListView2.ListItems.Add , , rst!ID
rst1.MoveNext
Wend
rst1.Close
End With
End Sub
Private Sub Form_Load()
Call Reload
End Sub
Function Reload()
Connect2dB
With rst
rst.Open "Select * from tblUsers", db, adOpenDynamic, adLockOptimistic
ListView1.ListItems.Clear
While rst.EOF = False
ListView1.ListItems.Add , , rst!ID
ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rst!UserName
ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rst!Password
ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rst!UserLevel
ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rst!RealName
rst.MoveNext
Wend
rst.Close
End With
End Function
List View
how i can search value in list view.
i have a textbox to search value.
i have entered some value in textbox and want to seach that in list view.
regards,
magej
List View
i have a list view that gets data on click of a combo box . the list view has 6 field but i need to sum up all the data of a particular field that means if i have 6 value under the column amount then i need to sum up them ,so that i can show the total amount .
plz tell me how to do that
List View
can we use freez panes for listview control ?
List View
Hi,
I have filled listview control with n number of row entries and the coloums headers are slno,name,age,mark1,mark2,mark3.If the user select any rows from the and the partcular record to be placed on the textboxes which are placed on the form. The slno colums headers is auto number gereration. After editing i want to replace the original record with new one.
Help pls
List View
Hello !
I am doing an startup programs manager. I have a list view with 3 columns.
I have loaded all startup exe in to a column of the listview. Now I need to insert icons of the loaded exe to the list view next to each item I am alright in loading handling ListView.
My problem is I can extract and drawn all the Icons of the startup exe files to a picture box using its HDC. But how can I Transfer extracted small icons to the list view.
I also try extracting icons directly to the list view. But I does not have HDC. So I had to draw it on the form or to a picture box.
Please help me how i can put the icons of the startup programs exe to the listview.
* Question summery !
I can use either SHGetFileInfo API or ExtractAssociatedIcon API to extract Icons from exe’s. But loading to a list view is my real problem.
List View
when I try to insert data to list view from the data base there is a running error the imagelist must be insiallized before it can be used.
this is the code that I had been written.
Dim List As ListItem
SQL = "SELECT * FROM Industry where Industry.Category = '" & Combo1.Text & "' ;"
Set mrs = Query(SQL)
Do While Not mrs.EOF
Set List = ListView1.ListItems.Add(, , mrs.Fields(0), , 1)
List.SubItems(1) = mrs.Fields(1)
List.SubItems(2) = mrs.Fields(2)
mrs.MoveNext
Loop
thanks for your help
List View Tab
i want to sort ( ascending or desceding )
if user click on
List View Tab ( view ===) lvwReport ) ......
List View
I have 1 list view with 3 items in it, and a command button. When you click the command button, i want the next item in the list view to be selected. How do i do that?
List View
Hey people, Im trying to use a listview to show a list of files.
How would I go about making the list view show a certain list of files in a folder by using something like:
Code:
App.Path & "userdocs"
Then it would list the files that are in that directory.
Im using App.Path sence the directory will change on everyones computer that uses this program.
Thanks in advance for the help.
PS : The files that this will be showing have custom extensions like:
*.WDP
*.CODED
And a few others. How do I get it to only list those files that I have made with the custom extensions?
Thanks again.
List View
can we have scroll bars to list view
List View HELP
ok, im writing a program that has a summary window of all sales by employees...a nd i have everyhting all setup except for when i get to adding the employee ID and their sales to the listview
i worked out a sub to add it tot he listview, and it was working GREAT when i was using 1 ID, but then i added some data to the listview with 1 ID, then used a differnt ID(say '132'), and it worked... so then i did it again with the diff ID(123) and it gave me an index out of range error... so i ran it again did the 1 ID first and then a diff ID and then back to the first Id, and it added that sale to the original and ALSO added a new line to the listview... and im getting really confused on this... ill post the sub im using and if needed the whole project... PLEASE HELP IF POSSIBLE!!!
VB Code:
Sub AddToList(ID As String, Sale As Double) Form2.lvwSumm.Sorted = True Dim a As String Dim b As Double If Form2.lvwSumm.ListItems.Count = 0 Then Form2.lvwSumm.Sorted = False Dim X As ListItem Set X = Form2.lvwSumm.ListItems.add() X.Text = ID X.SubItems(1) = Sale Form2.lvwSumm.Sorted = True Else For i = Form2.lvwSumm.ListItems.Count To 1 Step -1 a = Form2.lvwSumm.ListItems.Item(i).Text If a = ID Then b = Form2.lvwSumm.ListItems.Item(i).ListSubItems.Item(i).Text Sale = Sale + b Form2.lvwSumm.ListItems.Item(i).ListSubItems.Item(i).Text = Sale Else Form2.lvwSumm.Sorted = False Set X = Form2.lvwSumm.ListItems.add() X.Text = ID X.SubItems(1) = Sale Form2.lvwSumm.Sorted = True End If Next End If Form2.lvwSumm.Sorted = TrueEnd Sub
Thanks
List View
Ok.. So I have a list view.. and it adds everything to it. But if thers so many things.. it starts adding them Horizontly.. Making different rrows.. I want it to add everything going down with a veritcle scroll Bar.. if you need to kno the settings i have.. or if u want a sreenshot just post back
List View Help...
Well, I need help with this List View and it's really annoying me... How can I make the data keep going down instead of like:
Data1 Data4
Data2
Data3
--
I want it to be like:
Data1
Data2
Data3
Data4
List View
how i can add a picture in list view
|