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




Stop Listview Loading


Hi everyone!

I'm filling a listview with a lot of data. If the user gets tired, he can press a button "Cancel" which should stop the listview loading.

To do that, in the loading loop I put a flag which is continously read at every cycle, for example:

Code:
While count<MaxCount And GoOn

'fill listview
'...
count +=1
End while

' Routine for cancelling
Private sub OnBtnCancel_click (...)
    GoOn=False
end sub
 

However, while the listview is filling up, I cannot press any button because the UI is freezed. So the Cancel button is unuseful.
Usage of Listview.BeginUpdate and Listview.EndUpdate() is useless.

The only way I found to make this work is to have the listview filled by another thread... but this is of course illegal because one should have the UI thread which created the listview to handle it, and not another thread.

Does someone have an idea?

Thank you




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Stop DOWN-loading, The Line Is Down Down Down!
If I want to download files from the internet, and whilst downloading I terminate the connection, how can I make my application stop from trying to keep downloading? It keeps trying on and on and on... Can someone provide me a simple solution, perhaps a codeline or two? It would be highly appreciated.

Can't Stop Form From Loading &lt;Resolved&gt;
Hello

I have several forms that do the same thing but just present a different format for the user. The user decides what format they want to work with and that is the form that is loaded. So I decided to put all the common code into a module to cut the size of the exe, streamline things and make it one stop shopping for mods to the code.

The code in the module checks controls on the form for the data to do it's calculations with. Now for the problem:

When the code in the module checks the state of controls on the form, the form gets reloaded all over again for each and every control that is tested.

This has created 2 problems:
1. Some of the things that the formload does mess up the subsequent operations in the module.
2. With close to 100 controls that can be queried this is a lot of overhead.

So my question is this is there a way to stop an already loaded form from being reloaded every time a remote procedure accesses one of it's controls?

I don't know if it makes a difference but I put all the common code into the module1.

Thanks

David

Errhandle - Stop Form Loading
I have a errhandle command in the form_load event of my form.

If the the errhandle function is called, I want the form to stop loading and, in fact, unload.

I've tried:


Code:
unload me

and/or

Code:
exit sub


and a few other things but they either come up with an error saying object was unloaded or the form doesn't unload at all.

Any ideas how I can stop the form continuing to load?

Thanks

Simon

Stop The Loading Of Any Images In An IE Window
hi,

I want to be able to load a hidden page through VB, and i just want it to load the text, I don't want it to load any images because that slows it down... any idea??

Thanks
digital_fortress



Found some Inet thing thanks neways.



Edited by - digital_fortress on 8/13/2007 1:25:56 PM

Stop Showing The System Loading Controls?
In my form_load, I'm loading a 100 instances of a shape:

Code:
For n = 1 To 100
Load shpPerson(n)
shpPerson(n).Visible = True
Next

However, I don't want to see the 100 instances appearing one at a time(even though they only take about a second to appear). I'd like it so that the form doesn't appear until all shpPerson shapes are loaded. I load the form using a Load form statement, and after loading all the shpPerson shapes, I have a me.show, but for some reason, I can still see the shapes loading.

Help!

Stop Listview Selection
I am trying to stop the first row in a listview being selected when the form is first loaded.
I have tried using the

Code:
Listview1.SelectedItem = Nothing

in the Form_Activate and this doesn't work.
There is no other control on the form to set the focus to.

Any ideas or workarounds?

Stop Listview Flickering?
Hi folks,

I am having trouble in preventing flickering while adding items to a listview.

Please help!

Stop Drag In Listview
I found this code


Code:

' REQUIRES THE MSGHOOK.DLL LIBRARY

Const WM_NOTIFY = &H4E
Const LVN_FIRST = -100&
Const LVN_BEGINDRAG = (LVN_FIRST - 9)

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _
Any, source As Any, ByVal bytes As Long)

Private Type NMHDR
hwndFrom As Long
idFrom As Long
code As Long
End Type

Dim WithEvents FormHook As MsgHook

Private Sub Form_Load()
' start subclassing the current form
Set FormHook = New MsgHook
FormHook.StartSubclass Me

' fill the ListView1 control with data
' ... (omitted) ...
End Sub

' this event fires when the form is sent a message

Private Sub FormHook_BeforeMessage(uMsg As Long, wParam As Long, lParam As Long, _
retValue As Long, Cancel As Boolean)

' the ListView might be notifying something to its parent form
If uMsg = WM_NOTIFY Then
' copy the MNHDR structure pointed
' to by lParam to a local UDT
Dim nmh As NMHDR
CopyMemory nmh, ByVal lParam, Len(nmh)

' check whether the notification is from the ListView1 control
' and whether it's the beginning of a drag operation
If nmh.hwndFrom = ListView1.hWnd And nmh.code = LVN_BEGINDRAG Then
' yes, cancel this operation
retValue = 1
Cancel = True
End If
End If
End Sub




but I can't get it to work (I have a lisview on my form).

It craps out at:

Dim WithEvents FormHook As MsgHook

Any ideas?

Stop Movement Of Listview Icon
hello friends,

I add items (as Icons) and set the view to Icons. When I select and move
one of the items within the listview control, it appears to drag outside the
boundaries of the listview control and the vscroll and hscroll bars appear.
The problem is I want the items to remain aligned, not randomly spread
around. Also, this is a problem because my list view control is about 2
inches square. Can I keep the icon within the white space of the control
and can I keep everything aligned?

How To Stop The Renew Index's For Listview ?
peace be with you

i make a small project used " listview "

i add a 3 items therefore the index's will be [ 1 - 2 - 3 ]

when i remove the index "2" the index's changes like this [ 1 - 2 ]

and number [2] is the index 3 before the removed

the question is :

how to set the index's not changes ??

thanks

Stop ListView Column Header
Hi Everyone,

I am using an example from VBnet about subclassing and responding to notifications from the ListView Header.

http://vbnet.mvps.org/index.html?cod...ifications.htm

The question I am trying to figure out is this. How can I get a column header to stop resizing once it has gotten to a location to a certain location. For example, stop column 1 from resizing any smaller when pt.X = 20. I would appreciate any help.

Thanks.

Stop ListView Selection When Not Wanted
Wow... that's a tough topic. It's easier to explain than what it means in the subject.

I have a TreeView-ListView interfase. The problem I'm having is when I right-click over the ListView, e.g., show it's corresponding popupmenu, and select an option which would not open any new menu or something. E.g., change some values to variables, or change the apearance of the app. What happens is that the mouse (I don't know how to explain it) "keeps" on selection status, and would select all the items you hover the mouse over after this. Of course, this would end if you click anywhere or sth. But I want to avoid this "autoselection status". Does anybody know how to do it??

How To Stop First Colume Edit In A Listview
How do you stop first colume edit?

ListView - Stop Icons Moving
Hi,
I'm using a listview control in the Icon mode, to display a control panel for my application. The only problem is that when a user clicks an icon, when you move the mouse it moves the icon as well.

Is there any way to stop the user moving the icon?

Stop And Start A Service From A ListView
Hi

I want to be able to stop and start a service that is selected from a ListView, I've tried searching but cant find anything, does anyone have any ideas?

Thanks



LIVERPOOL FOOTBALL CLUB - 5 times Champions of Europe!! 1977, 1978, 1981, 1984, 2005

FA Cup Winners - 2006

Edited by - johneast on 3/15/2006 6:31:40 AM

Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!

thanks!

Stop And Start A Service Selected From A ListView
Hi

I want to be able to stop and start a service that is selected from a ListView(using XP), I've tried searching but cant find anything, does anyone have any ideas?

Thanks


ListView Control. STop From Editing Items In Listbox
how can i stop from editing items in a listview control as shown in this picture:


http://www.po2upload.com/uploads/no_change.GIF

Stop Duplicating Items From Gettign Added In A Listview
Hey guys I have a listview called report. These items get added froma list6 click event.

But is there a way to prevent duplicate items in the report listview?

Thanks!

Loading TXT Into Listview
Hiya,

I'm creating a small database program... while doing some searching on thif forum I found this code:

Code:
Private Sub Cmdsave_Click()
Dim Cols As Integer
Dim Rows As Integer
Dim itemX As ListItem
Dim Str As String
Open "abc.txt" For Output As #1
'******If you want to print the headers do this:*****
For Cols = 1 To ListView1.ColumnHeaders.Count
Str = Str & ListView1.ColumnHeaders(Cols).Text & vbTab
Next Cols
Print #1, Str
'*****************************************************

For Rows = 1 To ListView1.ListItems.Count
Set itemX = ListView1.ListItems(Rows)
Str = itemX.Text
For Cols = 1 To (ListView1.ColumnHeaders.Count - 1)
Str = Str & vbTab & itemX.SubItems(Cols)
Next Cols
Print #1, Str
Next Rows
Close #1
End Sub
it works fine... but now I need to load the abc.txt backinto the listview (Listview1)

Is it possible to load these? or can I only load Access databases into a listview?

Tnx in advance

Loading Listview
I have a form with a textbox and listview control on it.
My problem is, when I load the listview and I type any text
in the textbox, the selected item is way down the bottom of the listview.
I would like when the user types, the selected text is at the top,
or when the user types and presses the enter key, the listview is loaded & sorted by the text in the textbox.
How do I do that?

While Loading To Listview .....Please Help
I have a huge a mount of data and I need to display them on a listview but the form hanGs while doing So ..

So what can I do To remove this hanging .

If is it because of the progressbar can someone addit to the project and upload it here.... please help me

See the Attachment

ListView Loading
Can anyone help me Improve the performance of the standard MS ListView Control.


I have an application which requires a sorted iconised/report view of data which can sometimes be several thousand items. Althougth the ListView copes with this amount of data once loaded each row takes longer and longer to be added (this is especially noticable once a few thousand items are bulk loaded.


I have tried turning off sorting until loaded and LockWindowUpdate until loaded, but I cannot improve the poor performance (the data has already been loaded into a treeview and is being added to the list in a similar fashion to Explorer).

Loading ListView Question
I load twelve ListView arrays from a database table. The ListView controls have Checkbox enabled. Names are added to the ListViews List from the table. If ...MyRecSet.Fields("CPerson") > ""... is true in the table this Person's ...Form1.Janlv(MyRecSet.Fields("DBox")).ListItems(c).Text = MyRecSet.Fields("EName") ... checkbox will be checked. My Listviews are, Janlv(), Feblv(), ..., Declv(). After loading all of the names in the Listview arrays I then move through the arrays and check the appropiate checkboxes. I'm trying to figure out how to do this without having a block of code for each array. Could some one help me out in combinding all of the Listviews into this one block of code. Here is my code for the Janlv(). Thanks

Code:
Set oConn = New ADODB.Connection
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & App.Path & "PTOTraclerdb.mdb"
Set MyRecSet = oConn.Execute("Select * From JanTable")
If Not MyRecSet.EOF Then
MyRecSet.MoveFirst
Do While Not MyRecSet.EOF
If MyRecSet.Fields("MonthName") = "Jan" And Form1.txtYear.Text = MyRecSet.Fields("CYear") Then
If MyRecSet.Fields("CPerson") > "" Then
For c = 1 To Form1.Janlv(MyRecSet.Fields("DBox")).ListItems.Count '- 1
If Form1.Janlv(MyRecSet.Fields("DBox")).ListItems(c).Text = MyRecSet.Fields("EName") Then
z = Form1.Janlv(MyRecSet.Fields("DBox")).ListItems(c).Index
Form1.Janlv(MyRecSet.Fields("DBox")).ListItems(z).Checked = True
End If
Next c
End If
End If
MyRecSet.MoveNext
Loop
End If
oConn.Close
Set oConn = Nothing

Listview Saving/loading
I need to save the data in both columns and then load it!

This project is so huge that now i am so drained i can't figure out how to do this

The other catch is i need to save it like so...

Code:
sitename;url
sitename;url


Or a better way if anyone knows of one The url is in the second column, the sitename is in the first. I think i have the saving sort of down just need to continue trying

Thanks Paul.

<Edit>
Sorry there are some more catches if it helps at all, i need to check if the url is already in the text file, and if it is then skip that row.


Code:
Open App.Path & "Sites.txt" For Input As #filenum
strbuffer = Input(filesize, #filenum)
Close #FileNumber


Something like that then just check if strbuffer contains the url, that would be good enough right?

Loading A Database To A Listview?
Hey guys I have a database that I have been loading to a listbox, but I would like to add another column to the database, and I don;t think a listbox would allow more than one list of items.

I was wondering I have a listview called lvwitems and it has 3 columns. but I am also unfamalier with listviews and databases. What I would like is that when the database loads one item into a listview column, it loads stuff from the other columns into the coresponding columns into a listview.

Like for eX, if a database has like

Notepad.exe, name of the program "Notepad", then a brief description of the file
This is in 3 different columns in my database but are all in the same row.
can this be done, where if notepad.exe gets loaded into a listview, the rest is the corresponding row in the database gets loaded into a listivew?

I use this code to load to a listbox.
VB Code:
Public Sub FillCombo(objComboBox As ListBox, _                        oConn As ADODB.Connection, _                        strSQL As String, _                        strFieldToShow As String, _                        Optional strFieldForItemData As String)             Dim oRS As ADODB.Recordset  'Load the data              Set oRS = New ADODB.Recordset              oRS.Open strSQL, oConn, adOpenForwardOnly, adLockReadOnly, adCmdText              With objComboBox          'Fill the combo box                .Clear                If strFieldForItemData = "" Then                  Do While Not oRS.EOF      '(without ItemData)                    .AddItem oRS.Fields(strFieldToShow).Value                  oRS.MoveNext                  Loop                Else                  Do While Not oRS.EOF      '(with ItemData)                    .AddItem oRS.Fields(strFieldToShow).Value                     .ItemData(.NewIndex) = oRS.Fields(strFieldForItemData).Value             oRS.MoveNext                  Loop                End If              End With              oRS.Close                 'Tidy up              Set oRS = Nothing          End Sub Private Sub Form_Load()'Dim con As ADODB.ConnectionDim con As ADODB.ConnectionDim strSQL As StringDim strCol As StringSet con = New ADODB.Connectioncon.CursorLocation = adUseClientcon.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source= C:Documents and SettingsOwnerDesktopDatabaseMain1.mdb;"strSQL = "SELECT * FROM table1"strCol = "field1"Call FillCombo(list1, con, strSQL, strCol)con.CloseSet con = NothingEnd Sub


Thanks1

Loading A Textfile In ListView
the listview doesn't populate when i load a file... I'm not getting an error or anything. everything is in 1 column no multiples or anything advanced


VB Code:
Dim FileName, iFile As String On Error GoTo DoNothing     CmDg1.CancelError = True    CmDg1.DialogTitle = "Names List"    CmDg1.InitDir = App.Path    CmDg1.Flags = &H4    CmDg1.Filter = "all files (*.*)|*.*|names file (*.txt)|*.txt"    CmDg1.ShowOpen     FileName = CmDg1.FileName    Open FileName For Input As #1    While Not EOF(1)        Input #1, iFileListView1.ListItems.Add iFile    Wend    Close #1    DoNothing:

Loading Into Listview..can't Figure It Out
Hi all! VB-Noob here.
I made an Agenda for a schoolproject. I'm almost done but i've one problem... Reading a Listview from a file...
I know there are numerous threads about this, but i just can't figure it out.
I got the Write code from VBForums too, here it is:


Code:
'First create a file
Open "c:VBAdressenboek.txt" For Output As #1

'The Actual Saving
For i = 1 To ListView1.ListItems.Count
Print #1, ListView1.ListItems(i).Text & "|";
Print #1, ListView1.ListItems(i).ListSubItems(1).Text & "|";
Print #1, ListView1.ListItems(i).ListSubItems(2).Text & "|";
Print #1, ListView1.ListItems(i).ListSubItems(3).Text
Next i

Close #1


The saving works, so | is the seperator. Can anybode help with the reading code??

Thanx in advance!

Help - Loading An External Listview ..
hello,

quick question - can the data from an external listview control be 'copied' to a listview control on the local app?

if yes, no so quick question - how would this be accomplished? what controls would be used? Any help would be appreciated.

thanks,
jordan

***RESOLVED***Loading Listview Problem
I have a ListView control which is being loaded on form load procedure. I also provide a command button on the form whose purpose is to refresh the ListView control. This refresh button calls on the same code which is used to load the ListView on form load.

The ListView loads beautifully on form load but not when the refresh button is used (which as I said before calls on the same code which was used in form load?). When the refresh button is clicked it adds a bunch of blank lines at the top of the ListView control and then only some of the actual data below.

I did a Ctrl+Break and walked through the code. The code formats the grid as it should and begins looping through a recordset adding items to the ListView. After it gets through the tenth record, instead of adding the next record, it adds a blank line at the top of the ListView? Not sure why it is doing this. The recordset shows that data is there. It goes through the loop as though it is adding the data but then a blank row is added at the top. It does this for the remaining records.

Here is the code being called on both form load and refresh click event:

Private Sub LoadListView()

'Clear listview.
ListView1.ListItems.Clear
ListView1.ColumnHeaders.Clear

'Format ListView.
With ListView1
With .ColumnHeaders
.Add , "CompID", "CompID", 0, lvwColumnLeft
.Add , "Type", "Type", 650, lvwColumnLeft
.Add , "Vehicle", "Vehicle", 700, lvwColumnCenter
.Add , "Issuer", "Issuer", 3240, lvwColumnLeft
.Add , "Facility", "Facility", 1400, lvwColumnLeft
.Add , "Amount", "$ Amount", 1300, lvwColumnRight
.Add , "Price", "Price", 900, lvwColumnRight
.Add , "Analyst", "Analyst", 800, lvwColumnCenter
.Add , "Time", "Response Time", 2100, lvwColumnLeft
.Add , "TimeVal", "TimeVal", 0, lvwColumnLeft
End With

.View = lvwReport

' Open a recordset
MySQL = "SELECT tblCompRQST.Comp_id, [tblCompRQST]![deal-code] AS Vehicle, tblCompRQST.custom, " & _
"tblCompRQST.borrow_nbr, tblCompRQST.WU_id, tblCompRQST.WU_FacID, " & _
"IIf(IsNull([tblCompRQST]![custom]),UCase([tblWriteUp]![WU_Borrower]), " & _
"[Pilfile]![borrow_name]) AS Issuer, IIf(IsNull([tblCompRQST]![custom]), " & _
"[tblCapStruct]![FacDesc],[Pilfile]![loan_desc]) AS Facility, tblCompRQST.Analyst, " & _
"tblCompRQST.Price, tblCompRQST.Amount, tblCompRQST.Response_time, tblCompRQST.Status, " & _
"tblCompRQST.Type, tblCompRQST.Settled " & _
"FROM (((((tblCompRQST LEFT JOIN tblWriteUp ON tblCompRQST.WU_id = tblWriteUp.WU_id) " & _
"LEFT JOIN tblCapStruct ON tblCompRQST.WU_FacID = tblCapStruct.WU_FacID) LEFT JOIN " & _
"Pilfile ON tblCompRQST.borrow_nbr = Pilfile.borrow_nbr) LEFT JOIN tblMoodyCLOindustry ON " & _
"Pilfile.moody_code = tblMoodyCLOindustry.SSBIndustryCode) LEFT JOIN tblSPCLOindustry ON " & _
"Pilfile.sp_code = tblSPCLOindustry.SPIndustryCode) LEFT JOIN tblFIndustry ON " & _
"tblCompRQST.FIndustryCode = tblFIndustry.FIndustryCode " & _
"GROUP BY tblCompRQST.Comp_id, [tblCompRQST]![deal-code], tblCompRQST.custom, " & _
"tblCompRQST.borrow_nbr, tblCompRQST.WU_id, tblCompRQST.WU_FacID, " & _
"IIf(IsNull([tblCompRQST]![custom]),UCase([tblWriteUp]![WU_Borrower]), " & _
"[Pilfile]![borrow_name]), IIf(IsNull([tblCompRQST]![custom]),[tblCapStruct]![FacDesc], " & _
"[Pilfile]![loan_desc]), tblCompRQST.Analyst, tblCompRQST.Price, tblCompRQST.Amount, " & _
"tblCompRQST.Response_time, tblCompRQST.Status, tblCompRQST.Type, tblCompRQST.Settled " & _
"Having (((tblCompRQST.Status)='ACCEPTED') AND ((tblCompRQST.Settled)=No));"


Set MyDb = OpenDatabase(RDSDATA_PATH & "rdstables.mdb")
Set MySet = MyDb.OpenRecordset(MySQL)

'Execute code if MySet is not empty.
If MySet.RecordCount <> 0 Then

'Moves to the first record in the recordset.
MySet.MoveFirst

' Use values from recordset to populate listview control
'****THIS IS WHERE PROBLEM OCCURS****
For I = 1 To MySet.RecordCount
.ListItems.Add I, , MySet.Fields("Comp_id")
With .ListItems(I).ListSubItems
.Add , , MySet.Fields("Type")
.Add , , MySet.Fields("Vehicle")
.Add , , MySet.Fields("Issuer")
.Add , , MySet.Fields("Facility")
.Add , , Format(MySet.Fields("Amount"), "#,###.00")
.Add , , Format(MySet.Fields("Price"), "###.0000")
.Add , , MySet.Fields("Analyst")
.Add , , MySet.Fields("Response_time")
.Add , , Format(MySet.Fields("Response_time"), "yyyymmddhhmmss")
End With
MySet.MoveNext
Next I
'***********************************

End If

End With

MySet.Close
MyDb.Close
Set MySet = Nothing
Set MyDb = Nothing

'Set Sort Optiot button to Ascending (A-Z).
Option2(0).Value = True
lblSelectA.Caption = "0"

End Sub

Loading Listview Icons From File
Hello,

Could anyone please help me on how to load listview icons from the same files you are loading from.


Thanxs

vbBoy.

Loading/Saving Listview To A File
How do you load a listview from a file and save the items to a file?

Loading JUST Text Files Into A ListView
Hi, I want to have a ListView control list JUST the text files in a folder that I precode into it. Also, I'd like to use the offical text file Icon for it if possible.

Any suggestions?

Thanks,
Jordan

Loading Folders/files In Listview Is Slow ???
Hi,

I am writing a Backup Application using VB6. Here I need to show treeview and listivew with Directories and Files like Windows explorer and allow user to select or drag files for backup. I have populated directory tree. that is fine. But in case of listview for showing selected Directory contents with windows icons I am using Filesystemobject and then getting windows icons for the files and directories. In case of large directory it is taking time to load the files and directories. I treid with Findfirstfile and findnextfile apis also. still it is slow. Can anybody suggest me some good way of loading the files and folders in the listview with windows associated icons?

thanking you

regards
praveenp

Loading Folders And Files In Listview Is Slow ???
Hi,

I am writing a Backup Application using VB6. Here I need to show treeview and listivew with Directories and Files like Windows explorer and allow user to select or drag files for backup. I have populated directory tree. that is fine. But in case of listview for showing selected Directory contents with windows icons I am using Filesystemobject and then getting windows icons for the files and directories. In case of large directory it is taking time to load the files and directories. I treid with Findfirstfile and findnextfile apis also. still it is slow. Can anybody suggest me some good way of loading the files and folders in the listview with windows associated icons?

thanking you

regards
praveenp

Loading && Saving Text File To && From ListView
Hey Gurus!
Can anyone help me on how can I load & save text file(tab delimeted) to & from a listview control(common control 6(sp4))?
Thanks!

glenford@secomp-intl.com

Loading Files/folders In Listview Is Slow ???
Hi,

I am writing a Backup Application using VB6. Here I need to show treeview and listivew with Directories and Files like Windows explorer and allow user to select or drag files for backup. I have populated directory tree. that is fine. But in case of listview for showing selected Directory contents with windows icons I am using Filesystemobject and then getting windows icons for the files and directories. In case of large directory it is taking time to load the files and directories. I treid with Findfirstfile and findnextfile apis also. still it is slow. Can anybody suggest me some good way of loading the files and folders in the listview with windows associated icons?

thanking you

regards
praveenp

Regarding Loading Thousands Of Data In Listview Hangs Application[NOT RESOLVED]
Hi

i m using listview in report mode to load thousands of data from the database. while loading many data at time it takes much time......even sometimes my application hangs. what is the remedy for that??

thnks
saracjl



Edited by - saracjl on 7/22/2005 11:18:51 PM

Loading TreeView And Listview Icons From A Specified Folders Or Files Icons.
Hello,

I am creating a treeview app that looks like windows explorer. Problem is that I do not know how to get the Treeview + Listview icons from the folder or file items being loaded.


Can anyboby help please................................


Thanks

vbBoy.

Loading TreeView And Listview Icons From A Specified Folders Or Files Icons.
Hello,

I am creating a treeview app that looks like windows explorer. Problem is that I do not know how to get the Treeview + Listview icons from the folder or file items being loaded.


Can anyboby help please................................


Thanks

vbBoy.

InnerHTML && Listview... Not Loading "Fast" Enough...
I know I did decent job on coding (considering learning by the book & hard way), anyhoo... I can't, for the life of me, figure out why Listview isn't capturing all the data, I checked the web and it was loading fast like it was supposed to, but the Listview isn't inputting the data quick enuff before the web update its query.

Mind you that I don't have direct access to the database with the company, hence why I use innerHTML.  Care to give me some insight what I'm doing wrong or could do to improve this coding?

    On Error Resume Next
    Dim NextRow As Long
    Dim CountToSave As Long
    Dim CountSets As Long
    Dim x As Long
    Dim endx As Long
    Dim ReturnedText As String
    Dim CurRow As Long
    Dim sta As Variant 'test
    Dim abc As Variant 'test
    SArray(1) = "AL"
    SArray(2) = "AK"
    SArray(3) = "AZ"
    SArray(4) = "AR"
    SArray(5) = "CA"
'sarray continues down to 50 states
        
    AArray(1) = "A"
    AArray(2) = "B"
    AArray(3) = "C"
    AArray(4) = "D"
    AArray(5) = "E"
'aarray continues down to (26 letters)
    
    ColumnCount = 5
    CountToSave = 0
    LastSaveMark = 1
    CList.ListItems.Clear
    endx = CRM.Document.body.All.tags("td").length
    RowCount = CountRows
    NextRow = 0
    CurColumn = 0
    CurRow = 1
    TriggerNewRow = True
    tmrClock.Enabled = True 'timer
    tmrclock_Timer 'timer
        For Each sta In SArray 'test
            For Each abc In AArray 'test
                Text1.Text = abc 'checking if goes thru arrays (temp information to verify if it works)
                Text2.Text = sta 'checking if goes thru arrays (temp information to verify if it works)
                CRM.Document.getElementById("name").focus
                CRM.Document.myform.Name.Value = abc 'input name
                CRM.Document.getElementById("status").focus 'test
                SendKeys "{s}" 'send s to dropmenu
                CRM.Document.getElementById("state").focus
                CRM.Document.myform.State.Value = sta 'input state abbrev
                CRM.Document.getElementById("SearchIt").focus
                CRM.Document.getElementById("SearchIt").Click 'pull new data
                Do: DoEvents: Loop Until CRM.Busy = False
                For x = 0 To endx
                    DoEvents
                    ReturnedText = ""
                    ReturnedText = Trim(ReturnAfterRemoval(CRM.Document.body.All.tags("td").Item(x).innerText)) 'remove data i dont want in listview
                    If ReturnedText = "No Leads Found" Then
                        If TriggerNewRow = True Then
                            NextRow = CList.ListItems.Count + 1
                            CList.ListItems.Add
                            CList.ListItems.Item(NextRow).Text = CurRow
                            TriggerNewRow = False
                        End If
                    Else
                        If Not ReturnedText = "" Then
                        'Sleep (5)
                            CurColumn = CurColumn + 1
                            If TriggerNewRow = True Then
                                NextRow = CList.ListItems.Count + 1
                                CList.ListItems.Add
                            CList.ListItems.Item(NextRow).Text = CurRow
                            TriggerNewRow = False
                            End If
                            If CurColumn >= ColumnCount Then
                                CList.ListItems.Item(NextRow).SubItems(CurColumn) = ReturnedText
                                CurRow = CurRow + 1
                                CurColumn = 0
                                TriggerNewRow = True
                            Else
                                CList.ListItems.Item(NextRow).SubItems(CurColumn) = ReturnedText
                            End If
                        End If
                    End If
                Sleep (5)
                Next x
            Next abc
        Next sta
    tmrClock.Enabled = False
End Function

An Error Occurred While Loading 'ThisDocument'. Do You Want To Continue Loading This Proje
When attempting to open a Microsoft Word document programatically using VB 6.0 Active x Dll the following error message titled "Microsoft Visual Basic" appeared

An error occurred while loading 'ThisDocument'. Do you want to continue loading this project?

once i click no it throws an error with no 5981 i have trapped that in the below segment
and if i click yes it opens up and says that " word cannot fire event"

Code: vbCodeOPen
   On Error goto Err_Occured
    If wrdDocument Is Nothing And Not wrdApplication Is Nothing Then
                Set wrdDocument = wrdApplication.Documents.Open(sSourceFilepath)
    End If
Err_Occured:
    MsgBox Err.Description
    MsgBox Err.Number
    If Err.Number = 5981 Or Err.Description = "Method '~' of object '~' failed" Then
        If Not wrdDocument Is Nothing Then
            wrdDocument.Close
            Set wrdDocument = Nothing
            MsgBox "Error Occured while processing documents"
        End If
End Function


once the error is trapped i close the word instance which i created.
but when i tried in windows 98 and word 97 the winword crashes.

and when i process an other good one an MS word instace is already created ?

can anyone please tell me what the problem is and its workaround ?

Loading Obtjects When Form Loading Or Changing Values
when my form is loading some textboxes has to load automatically, like 30 and If I change the value with a button to 31 textboxes should be load.
I know within an array, but what 's the exact instructions that I need.

How can I do that??
thx for the help

Stop Error? Or I Will Stop You!
Oh the title i just wanted to get your attention. it looks like it worked though.

So now to the real problem, How do you make an easy error handler for a for next loop that sets or reads the properties of controls. and it tries to read a "timer.width".

I don't want ot know a way to avoid the error just a way to handle it.

Regards
E.P.

Display "Loading" In Label While Loading DataEnvironment
I have a cbo on a form that loads a large dataenvironment.  It takes 20-40 seconds to load the data, during which time I want a label on the form to display "Loading Data...".  I've tried the following code, but the label goes blank when the data is loading.  What did I do wrong?

CODEDim Str1 as String
Dim Str2 as String

Private Sub Form_Load()
   Str1 = "Ready"
   Str2 = "Loading Data..."
End Sub

Private Sub Combo1_Click()
If Combo1 = 001
   If Not Label1.Caption = Str2 Then
      Label1.Caption = Str2
   End If
   DataEnvironment1.Command1.Open
   If Not Label1.Caption = Str1 Then
      Label1.Caption = Str1
   End If
End If
End Sub

[Read] Need Help With Custom Scrollbars On A Listview Control! Or Skinning Listview..
I have been searching for weeks now to find a way to use a custom scrollbar to scroll a listview...

Like this:



Now I use an alternating BG function on my listview and I am currently using the ensurevisible method of scrolling a listview...

Is there a better way?

I will post some example projects if needed...

But how would I use a custom scrollbar on a listview control

Thanks for helping

How To Unselect Listview Row When I Click On White Area Of Listview Under Rows?
Hi all. could any one show me how i can detect if user clicked(left and write) on white area of listview as shown in the pic. When i say white area i mean area where there is no row in listview . I want to detect click on that white area and be able to unselect row and make frame invisable.

2 ListView Questions. 1 About Selecting Records. 2 About Adjusting Listview Box Size.
Hi,
I'm changing some of my programs to use a ListView instead of a ListBox.

1. On selecting a record how do I pass the info from the fifth column to another Sub? (I have .FullRowSelect = True)

2. I'm dynamically adjusting the column widths to the maximum length of the data going into the column. Is there a way to dynamically adjust the width of the listview box itself to be the sum of the column widths?

Thanks,
Al.

How To Unselect Listview Row When I Click On White Area Of Listview Under Rows?
Hi all. could any one show me how i can detect if user clicked(left and write) on white area of listview as shown in the pic. When i say white area i mean area where there is no row in listview . I want to detect click on that white area and be able to unselect row.

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