Important alert: (current site time 7/16/2013 2:32:43 AM EDT)
 

winzip icon

Final 2.4.6- HyperList NGEN! The last Listview control you will ever need..

Email
Submitted on: 1/4/2007 4:09:03 AM
By: Steppenwolfe 
Level: Intermediate
User Rating: By 80 Users
Compatibility: VB 6.0
Views: 48816
author picture
(About the author)
 
     Updated the Find routine as requested, also updated a couple skinheader routines. This will be the last update.. Bugfixes and Additions to 2.4.4- Fixed subitem edit scroll, mousewheel support, alphabar reset. Extended example with xp skinned header, row drop in list. Bugfixes and Additions to 2.4.3- Added column drag insertion marks. Changed checkboxes from ownerdrawn to state image list. Many small bugfixes.. Bugfixes to 2.4.2- A lot of fixes and rewrites, cleaned up all the classes, fixed various feature issues. Added an internal access demo. Bugfixes to 2.4- Crash on some foreign language versions of xp resolved. Edit box placement issue, bg image overpaints and other misc fixes are in. Ver 2.4 Is Up! Fixes are in, added a find function and right align text property. Barring any future bugfixes this will be the last version. __________________________________________________ Ver. 2.3 Is Up! Unicode on demand. Unicode support has been completely restructured to provide ansi only support (98/ME), and unicode when required. Skinned checkboxes added to other views. XP style class added, with header themed in-class. Cell level fonts and colors added. Top down rewrite of skinning classes, with skinned header text alignment added. Many bugfixes and major changes to this revision. __________________________________________________ Ver. 2.2 Is Up! The best listview on the block, just got better.. Added full ole drag and drop support. Subitem editing. Background images, and a ton of other features.. Many bug fixes and optimizations made, take a look.. Hyperlist NGEN Ver 1.1 __________________________________________________ The fastest, most featured, most powerful listview in this language! Three data access modes, Virtual, Custom Draw, and Hyper Mode. All of them unbelievably fast. Built in storage and sorting in a virtual listview hybrid. Skinned Headers/Scrollbars/Checkboxes and Selector Bar. User definable skin color schemes, theming, row decoration, per cell font and color formatting, and hundreds of properties and functions. Hope ya like it..

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 16 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
10/8/2006 10:59:03 AMSajey

GREAT WORK. 5 Globs from me
a small problem. try clicking "Scroll bar Flat" check box.. and click again, its comes back in a dark colour!!
(If this comment was disrespectful, please report it.)

 
10/8/2006 3:15:08 PMSteppenwolfe

Sajey
Note that some properties should be set at design time only, (like flat scrollbars), but I tried to work them into example anyways.
(If this comment was disrespectful, please report it.)

 
10/8/2006 4:12:14 PMDanny

Must have taken a lot of hard work. Can't rate any less than 5. Good job. :)
(If this comment was disrespectful, please report it.)

 
10/8/2006 5:36:21 PMLight Templer

Hi John, once more: Great piece of software! Really cool!
Very small tings to fix: I got Sajey's bug, too. And I got one checkbox too many in header line when column size is fixed and I move the mouse over the 2nd column. Regards and of course my *****+ for this job - LiTe
(If this comment was disrespectful, please report it.)

 
10/8/2006 6:22:37 PMOption Explicit

Have only scratched the surface of the code so far but this is a beautiful piece of work for sure. Am looking forward to playing around with it more, in the meantime take *****.
(If this comment was disrespectful, please report it.)

 
10/8/2006 6:38:51 PMmichael doering

Hi,
another very cool project from you.

For my first short testing, all will
work very fine but when I click the button 'Remove Duplicate' then the
app will closing immediate.
(If this comment was disrespectful, please report it.)

 
10/8/2006 7:13:06 PMSteppenwolfe

Lite,
Sajey thing is not bug per se, only different skin for scrollbar applied after property change (there are 5 skin themes).
I will look at checkbox, (probably just needs a refresh).
Matt,
thanks..
Michael,
what os? I only have xp to test, so..
Step through RemoveDuplicates proceedure, and tell me exactly what line causes failure(email), and I will try to fix.
I have fixed a couple things I noticed today as well, expect an update tomorrow.
Working on ole item drag drop, and (maybe) custom edit controls..
(If this comment was disrespectful, please report it.)

 
10/8/2006 10:52:47 PMenmity

what can i say, you crazy guy;)
(If this comment was disrespectful, please report it.)

 
10/8/2006 11:11:23 PMenmity

feature wish list:1. editing support for all columns/rows(textbox/combobox etc.)? 2. progressbar in any cell?
(If this comment was disrespectful, please report it.)

 
10/9/2006 1:54:28 AMenmity

noticing your photo, tell u what, i just saw the "Back to the Future" Part I/II/III again... ;)
(If this comment was disrespectful, please report it.)

 
10/9/2006 4:21:20 AMPhantom Man

Brilliant Job.

But I did notice if you select a different skin other than classic then check the flat header check box then uncheck it again, the header reverts back to classic style.

Kind regards
Gary.

(If this comment was disrespectful, please report it.)

 
10/9/2006 4:36:47 AMSteppenwolfe

Phantom,
That is only limitation of example..
I did a number of fixes today, working on ole drag, when it is done, I'll post 2.2.
(If this comment was disrespectful, please report it.)

 
10/9/2006 4:37:22 AMRichard Mewett

Great job extending/enhancing your original HyperList control! *****
(If this comment was disrespectful, please report it.)

 
10/9/2006 4:50:02 AMSteppenwolfe

Enmity,
Actually, I look like construction worker, (or so I'm told). Long hair, beard, play hockey on the weekends, and still get in the occasional bar brawl. I am.. the anti-nerd ;o)
Thanks for the overwhelming response people, glad you liked it..
(If this comment was disrespectful, please report it.)

 
10/9/2006 5:02:43 AMRuturaj

Gr8 control ... just one suggestion, can you implement the List item separator line styles for your Listview control? In normal Listview, when we select Grid Lines, those are the solid lines drawn inside Listview (both vert and horiz; no control on that!). I will be really happy to see if you can provide Solid, Dotted, Dashed, Dot-Dash line styles as Listview Grid lines with option to select only Horizontal/Vertical grid-lines to show. vbAccelerator's S-Grid control allows to set whether Horiz or Vert or both grid lines to be drawn or not; but even that control does not support Grid line styles. If you manage to implement it in your fantastic Listview control then it will be a unique feature addition. What you think?
(If this comment was disrespectful, please report it.)

 
10/9/2006 7:26:38 AMbob8works

Great control. Count me as one of the testers of this code. 5* for you!
(If this comment was disrespectful, please report it.)

 
10/9/2006 8:02:56 AMT Jackson

203KB class module! There's more work in this than the NEO GEO bios for Mame, which is 170K. Richard, this submission is part of the mere %10 of in which your converter fails with.
(If this comment was disrespectful, please report it.)

 
10/9/2006 9:33:33 AMBert

Dumb question (i'm a beginner), but I will ask it anyway:
When I load your project in VB6 I get the message: "Unable to set versio compatible component c:\Windows\System32\hyperlist2.dll".

I can't seem to find anything in your project to compile this dll. How do I do this, your Hyperlist looks great but I can't try it without the dll.
(If this comment was disrespectful, please report it.)

 
10/9/2006 9:58:43 AMenmity

yes, the group feature, and the hierachical/tree list ;)
(If this comment was disrespectful, please report it.)

 
10/9/2006 11:38:27 AMStan Amditis

OOOOOOH...sweet mystery of life at last I found you!
(If this comment was disrespectful, please report it.)

 
10/9/2006 12:15:49 PMSteppenwolfe

Rutararaj,
What your asking would mean switching to owner drawn control, would require complete rewrite.
Bert,
version message is expected. This is ocx, not dll. To compile, highlite the usercontrol in the project group window, in menu, go to projects > properties. Select the 'Component' tab. Empty the textbox with the path. Save the project and then from menu File > Make Project Group.
Then, do these steps a second time, but from the component tab, select option 'Binary Compatability'.

(If this comment was disrespectful, please report it.)

 
10/9/2006 1:56:43 PMDave

Excellent work. I would like to see a "combo" style control like Enmity suggests which offers grouping and treeview/list support too. By far one of the best listview controls i have seen.
(If this comment was disrespectful, please report it.)

 
10/9/2006 5:16:25 PMRobert

Great control. Work very fine. 5* for you!
(If this comment was disrespectful, please report it.)

 
10/9/2006 5:21:15 PMSteppenwolfe

Dave,
Adding combobox, would mean modifying row height, to do this without altering icon size means ownerdrawing control to capture measureitem message. This would require a complete rewrite of control, (scrollbars, headers, items, everything), and.. you would lose a lot of speed. So, no combo, certainly no treeview, (..dream on enmity).
I will make subitems editable, add drag and drop listitems, and fix the bugs, but that's about it..
(If this comment was disrespectful, please report it.)

 
10/9/2006 8:29:55 PMDavid Mamani Enaro

I test it on win98 and it doesnt work. something with the conditional compilation for unicode. and never draw the control so. i supouse that this control are made for windows xp.
(If this comment was disrespectful, please report it.)

 
10/10/2006 2:19:45 AMSteppenwolfe

David,
It should work in 98, (that is why there _are_ compiler arguements, for legacy os). Just takes some extra work to compile it. Language support is NT on up (NT4 to Vista), legacy system like 98 doesn't have proper unicode support, hence the need for workarounds. I don't have 98 to test, maybe someone with older os can get it working and post instructions..
(If this comment was disrespectful, please report it.)

 
10/10/2006 11:32:57 AMHeriberto Mantilla Santamaria

Another big project and excellent submission, you're my master 5G for you.
(If this comment was disrespectful, please report it.)

 
10/10/2006 4:06:07 PMSteppenwolfe

New version going up late tonight. Bugs are gone, (I hope), and a lot of new features, including ole drag and drop, and editable subitems..
(If this comment was disrespectful, please report it.)

 
10/12/2006 4:13:01 AMenmity

when editing, pressing enter, should accept the changes, but now no response.
(If this comment was disrespectful, please report it.)

 
10/12/2006 5:23:35 AMIosif Dohi

I learn a lot from your projects. 10x. 5*
(If this comment was disrespectful, please report it.)

 
10/13/2006 12:24:50 PMT304PK

Great lump of code and UI. OOOOO....
If i am allowed to add to wishlist: How about implementing column-based grouping, either emulating groups in XP TV or Outlook OGrid?
(If this comment was disrespectful, please report it.)

 
10/13/2006 2:15:27 PMSteppenwolfe

T304PK,
I have had a few requests like this, gridlines, combo, etc. but what people do not realize is that this is a listview, and is not ownerdrawn, so such things are nearly impossible to incorporate, and are meant for a custom grid control.. -but, you will never find a grid that can load 100k items in 1/100th of a second either.. ;o)
Next update is coming, skinned check in all views, find function, per cell formatting expanded, bug fixes, etc. Maybe by the weekend..
(If this comment was disrespectful, please report it.)

 
10/14/2006 12:19:40 AMRuturaj

I have sent you email regarding the same issue and now posting the same issue here in this comment area as well. When I changed the Font of List control, its affecting only the Header of Listview and not the items. I want to change the font of Items as well; but couldn't find a way for how to change it. Can you please let me know this? My email address is: mailme_friends@yahoo.com

Thanks & Regards,

Ruturaj.
(If this comment was disrespectful, please report it.)

 
10/14/2006 2:19:43 AMSteppenwolfe

Rutaraj,
That is because you only have Ariel Wide unicode font on your system, (by default), so when you change font to something that is not available in unicode, system switches it back.
Next version has unicode support on demand, (even at runtime), and support for 98/ME. Sometime this weekend..
(If this comment was disrespectful, please report it.)

 
10/14/2006 4:15:09 AMRuturaj

Thanks for your feedback. I was trying to set Verdana font with size = 8. Should this cause any trouble in setting Font for items? If that's so, then I'm certainly waiting for your next version of this control.
(If this comment was disrespectful, please report it.)

 
10/14/2006 3:53:05 PMSteppenwolfe

Rutaraj,
Just wait for finished control, probably 2 revisions left.
(If this comment was disrespectful, please report it.)

 
10/18/2006 2:15:37 PMSteppenwolfe

Still a couple todo's with this..
I went through a lot of trouble trying to make this backwards compatable with 98/ME, but can not test it, let me know if it is working now in legacy os, (and be specific please!).
xp header class needs a little work, and some unicode stuff todo, should be one more version..
(If this comment was disrespectful, please report it.)

 
10/18/2006 8:48:51 PMYKC

Great codes! but if it can export content to Excel would be very very nice.
(If this comment was disrespectful, please report it.)

 
10/19/2006 2:46:22 AMLight Templer

People, stop this guy! Else he 'll rewrite Windows from scratch in VB ;-)))
(If this comment was disrespectful, please report it.)

 
10/19/2006 10:00:02 AMSteven

Steppenwolfe, you are one of the greatest VB developers I have seen. I rate you up there with Steve McMahon!
(If this comment was disrespectful, please report it.)

 
10/19/2006 12:41:22 PMSteppenwolfe

Hi Light, actually, is one of last vb projects for me, after this then a grid control, (maybe), then I am going to focus on c# and managed c++. Thought I would leave a couple unicode controls out there, as there are no good examples of this, (no wonder, it is a real pain to write ;o).
Steven, thanks for the compliment, but if it weren't for Steve, I would not know half of what I do now, his code has been a great source of inspiration for me. I only try to pick up where he left off..
(If this comment was disrespectful, please report it.)

 
10/20/2006 7:26:18 AMRuturaj

Hello Steppenwolfe; I have no words to thank you enough! The updated control now supports all those Fonts that I wanted to use in this Control. Many thanks for developing such a fantastic control! I do agree with Steven ... you are surely one of the gr8 VB programmers I have seen ever and I feel very fortunate to get an opportunity to talk with you directly!
(If this comment was disrespectful, please report it.)

 
10/20/2006 9:10:51 AMenmity

waiting for the "ultimate grid"
(If this comment was disrespectful, please report it.)

 
10/20/2006 11:28:05 PMTuanHai

Greatest controls I've seen.
It's more usefull if you add more method: LoadRecordset because I dont know how to get in fastes way from a from recordset with ... 100 milions records.

And same with enmity, waiting for the "ultimate grid"

Many thanks! (w/ 50*)
(If this comment was disrespectful, please report it.)

 
10/21/2006 1:28:37 AMSteppenwolfe

One note: move manifest file from harness folder to another folder, or delete it, if you are having trouble with compiled project. I will fix it in next version.
TuanHai, load recordset, but what format? Access, DB3, Oracle.. you see the problem? Is not needed anyway, callback interface asks for record data when item is scrolled into view, just look at database demo for example, or search google for virtual listview for c++ examples.
(If this comment was disrespectful, please report it.)

 
10/21/2006 10:02:51 AMWalter

Hi
Very nice code
I try to load records with .itemadd and .subitemadd
But I can not get it to work?
Do you have to first copy your data into an array and then use .LoadArray?(is this the only way to do it)
(If this comment was disrespectful, please report it.)

 
10/21/2006 5:23:36 PMSteppenwolfe

If you mean by 'records', you are using a database, then you don't have to initialize anything. You only have the listmode as database, and to set the setitemcount property to max records. If you are using item data, then at a minimum, you have to initialize the array, and load pointer into the list before you can add items, ex.
'in form load
InitList 0, 2
PutArray
'add item
ucHyperListNG1.ItemAdd 1, "", "test123", 1, 1
ucHyperListNG1.SubItemsAdd 1, 1, "sub1"
ucHyperListNG1.SubItemsAdd 1, 2, "sub2"
It's all in the notes/examples people..
(If this comment was disrespectful, please report it.)

 
10/23/2006 6:43:37 AMPMTechDude

Looks like there is a problem while connecting to external DB (SQL Server).
I am doing it like this.

Function fetchData(eRecords As Enum_Records, Optional fromDate As Date, Optional toDate As Date)
Dim rstCount As Recordset
Connect
Set rstCount = CON.Execute("sp_Fetchlog 1," & eRecords & ",'',''") 'Gets the total row count
Set rst = CON.Execute("sp_Fetchlog 0," & eRecords & ",'',''") ' Gets the actual data
With grDBLog
.SetItemCount rstCount.Fields(0)
End With
End Function

Continued in the next msg->
(If this comment was disrespectful, please report it.)

 
10/23/2006 6:44:19 AMPMTechDude

(Contd..)
Private Sub grDBLog_eHIndirect(ByVal iItem As Long, ByVal iSubItem As Long, ByVal fMask As Long, sText As String, iImage As Long)
With rst 'Private variable
Select Case iSubItem
Case 0
sText = rst.Fields("fn1").Value & ""
Case 1
sText = rst.Fields("fn2").Value & ""
Case 2
sText = rst.Fields("fn3").Value & ""
Case 3
sText = rst.Fields("fn4").Value & ""
Case 4
sText = rst.Fields("fn5").Value & ""
Case 5
sText = rst.Fields("fn6").Value & ""
End Select
.MoveNext
End With
End Sub

The problem is, whenever I scroll/ select a row, the row is re-painted with some other data. The same thing is happening when the headers are resized.

Did anybody see this?

More details
1. OS - XP SP2
2. VB - VB6 Enterprise SP6

(If this comment was disrespectful, please report it.)

 
10/23/2006 8:58:10 AMbicio

The test crashes the vb ide soon after the form load (maybe the subclasser?).
My config:
win xp sp2
vb6 sp6 (italian ed.)

The MSVC debugger reports an "access violation" in vb6.exe

Another point: the control project has a reference to the MSCommon Controls cause the unused variable m_oListItem declared as ListItem.

Thanks
(If this comment was disrespectful, please report it.)

 
10/23/2006 10:04:20 AMSteppenwolfe

Techdude,
I see you passing the fields, but I do not see you using iItem to fetch by record index.
(If this comment was disrespectful, please report it.)

 
10/23/2006 10:57:23 AMSteppenwolfe

Techdude, I just noticed the 'movenext' in your routine. This is not proper method. Iitem is ByVal, it is the number of the row requesting data. You have to map this to a record index, then pass the fields from that record into isubitem.
bicio,
Don't know, works fine here, same os (engl). Can you step through it, and give me point where it fails?
(If this comment was disrespectful, please report it.)

 
10/23/2006 11:20:10 AMSteppenwolfe

bicio,
m_olistitem is used in ole drag and drop demo. Are you using this version (2.4)?
(If this comment was disrespectful, please report it.)

 
10/23/2006 10:02:44 PMTuanHai

Hi Steppenwolfe,
Normally, when I load data to VSFlex Grid, I usually use this code:
-------------------------------------
'// Turn-off Redraw (for fast operation)
vsfGrid.Redraw = flexRDNone

'// Load data to grid
Set oRS = objBrowser.oDataClass.GetAll(vstrMyCriteria:=strMyCriteria, vstrMyOrder:=strMyOrder)

'// Method 1: Load Data to Grid using Recordset
Set vsfGrid.DataSource = oRS '// <-- this mean what I have to say.

FormatGrid '// This is my own function to re-format the grid

'// Turn-on Redraw
vsfGrid.Redraw = flexRDDirect

(If this comment was disrespectful, please report it.)

 
10/23/2006 10:10:26 PMTuanHai

Quoted: TuanHai, load recordset, but what format? Access, DB3, Oracle.. you see the problem?
--> No need to Identify what kind of database, if you see my example above and if you used to use some kind of 3rd party's grid available in market then you will see what I mean. Normally I always to use .DataSource = objRS to load a recordset to a grid. I dont know how they do inside that method but rather fast I think. If I use objRS.GetString (return an array of records) then this way is badly slow with huge of amount records.
(If this comment was disrespectful, please report it.)

 
10/24/2006 11:30:14 AMSteppenwolfe

TuanHai,
I think you are missing the point of a virtual listview. Why would you want to load the records when you do not have to? If you have database connected to your app, and you are loading records virtually, you are doing so with a small memory footprint, and with large database, better display speeds. A grid that is loading the records from a record object, is likely only parsing out record data into internal structs, something you could do manually with this example.
(If this comment was disrespectful, please report it.)

 
10/24/2006 2:14:24 PMSteppenwolfe

Also -'there is no need to identify what kind of database' - of course there is.. different database is formatted in different way. Grid control probably has binding to system libraries and db drivers to interpret file. Nothing is done 'automagically'.
So to write this feature, you would have to figure out what libraries, and what calls to make, (no doubt this is poorly documented) /or/ method of opening file as binary, determining format from header, then parsing data from records. Either way, it is a lot of work, all to save programmer from 5 minutes of effort to write a loop to frontload records..
(If this comment was disrespectful, please report it.)

 
10/24/2006 3:41:26 PMbicio

Hy steppenwolfe,
I'm using ver 2.4 and I can confirm that the variable m_oListItem (in the user control project) is totally unused and unreferenced.
The vb ide crash seems to happen into the skinheader wndproc routine.
Commenting the .skinheader call in the frmCustomDraw Form_Load event avoids the crash.
(If this comment was disrespectful, please report it.)

 
10/24/2006 10:07:50 PMTuanHai

OK. May be I am missing the point of virtual listview. Just because I always deal with loading a big ADO recordset to the grid for displaying. I will see the code detail to see how to use it in fastest way as your demo.

Many thanks! You are one of the greatest in PSC.
(If this comment was disrespectful, please report it.)

 
10/25/2006 1:10:50 AMSteppenwolfe

Sorry TuanHai, but would be a lot of coding just for small convenience.. Look carefully at virtual method, that is meant for displaying large database.
Bicio, I will send you an email.
(If this comment was disrespectful, please report it.)

 
10/25/2006 12:57:15 PMSteppenwolfe

Is anyone else having crashes in ide? If so, speak up now..
(If this comment was disrespectful, please report it.)

 
10/25/2006 11:11:11 PMenmity

OS: windows 2003, sp1, Simplified Chinese

VB: VB6, enterprise, Simplified Chinese

condiction: normally closing the test window, all ok. BUT! forcely pressing the STOP button will cause the whole VB6 IDE to CRASH!!!!!!

(If this comment was disrespectful, please report it.)

 
10/26/2006 1:40:31 AMSteppenwolfe

Enmity, It is createwindow'd control And multiple subclassing, you are -Never- supposed to hit End button.
I am talking about normal use (not abuse) here..
I think I found problem, just waiting to verify with Bicio. Seems like unicode issues on some european language versions of xp sp2. I will post a fix lator. Thanks
(If this comment was disrespectful, please report it.)

 
10/27/2006 6:19:26 AMenmity

i never press stop, only that time I try to duplicated the crash problem mentioned by the other users.
(If this comment was disrespectful, please report it.)

 
10/27/2006 12:11:42 PMSteppenwolfe

Probably one more bugfix left, I will look into it this weekend..
(If this comment was disrespectful, please report it.)

 
10/28/2006 8:57:11 PMferd(z)

I've compiled your control to ocx and duplicated the database form and related components in vb5 and it WORKS! though i have'nt dig deep enough.

Please accept my humble 5 globes.
(If this comment was disrespectful, please report it.)

 
10/29/2006 11:31:44 AMSteppenwolfe

Ferd,
Glad to hear it works in vb5, (though I am betting a couple changes would be needed to make it fully backwards compatable).
(If this comment was disrespectful, please report it.)

 
10/30/2006 1:05:16 PMJoe Fisher

Okay what am I doing wrong here. I have never worked with list boxes before.

It loads but I cannot see any text.

Private Sub LoadView()

Dim rc As Long
adoPrimaryRS.MoveFirst
rc = 1
Do Until adoPrimaryRS.EOF
ucHyperListNG1.ItemAdd rc, "", adoPrimaryRS!PO_Number, 1, 1
ucHyperListNG1.SubItemsAdd rc, 1, adoPrimaryRS![Part Number]
ucHyperListNG1.SubItemsAdd rc, 2, adoPrimaryRS!Qty
ucHyperListNG1.SubItemsAdd rc, 3, adoPrimaryRS!Price
ucHyperListNG1.SubItemsAdd rc, 4, adoPrimaryRS![Shipping Method]
ucHyperListNG1.SubItemsAdd rc, 5, adoPrimaryRS!Date
ucHyperListNG1.SubItemsAdd rc, 6, adoPrimaryRS!ID1
rc = rc + 1
adoPrimaryRS.MoveNext
Loop

End Sub
(If this comment was disrespectful, please report it.)

 
10/31/2006 8:59:10 AMSteppenwolfe

Joe Fisher,
Start by -reading the notes-, and following the examples..
Did you initialize the array as in the example? Is the listmode set properly? Any error in debug window? If there are errors, you probably did not initialize listview properly.
(If this comment was disrespectful, please report it.)

 
11/4/2006 9:43:34 AMSteppenwolfe

Thanks to everyone for their support ;o)
I am working on an update, will post it in a few days..
(If this comment was disrespectful, please report it.)

 
11/5/2006 8:59:04 PMenmity

still, the last grid pending...
(If this comment was disrespectful, please report it.)

 
11/6/2006 9:48:42 AMSteppenwolfe

I think there is one more bugfix left, and expand the methods demo a bit, maybe next week.
Enmity, maybe the end of December, if I get time.
(If this comment was disrespectful, please report it.)

 
11/10/2006 7:30:33 AMbehnam

tanx for the programme
best and nice
(If this comment was disrespectful, please report it.)

 
11/11/2006 5:18:05 AMAmol Tarte

Really Great Work Sir!!! 100K Times thanks to you for this awesome submission. You have taken a lots of efforts for it. Thanks again for the same.
(If this comment was disrespectful, please report it.)

 
11/11/2006 5:48:14 AMAmol Tarte

This is my code...
Dim rs As New ADODB.Recordset

Private Sub FetchRecords()

With rs
Select Case iSubItem
Case 0
sText = .Fields(0).Value
Case 1
sText = .Fields(1).Value
Case 2
sText = .Fields(2).Value
Case 3
sText = .Fields(3).Value
Case 4
sText = .Fields(4).Value
Case 5
sText = .Fields(5).Value
End Select
.MoveNext
End With
End Sub

I'm facing the same problem that TechDude is facing. ie.

whenever I scroll/ select a row, the row is re-painted with some other data. The same thing is happening when the headers are resized.

You suggested techdude that movenext is not the proper way, please give us another way, I cant understand what u r saying. ie. map the record to it, use iItem, dont use .movenext etc.
Can u please give an example that how can we add may records without using movenext?
(If this comment was disrespectful, please report it.)

 
11/11/2006 4:01:56 PMCarlos Yakimov

I wish a .NET version ! =D
(If this comment was disrespectful, please report it.)

 
11/11/2006 5:51:32 PMSteppenwolfe

Amol,
You have to map lItem to record index number, (this is mentioned three times in db example notes, btw)
Carlos,
Should be easy enough to convert..
(If this comment was disrespectful, please report it.)

 
11/12/2006 1:05:54 AMAmol Tarte

Dear Sir,
I know that you have mentioned 3 times that we have to map iItem to records index number. But I didnt find anything to do so other than .MoveNext. I'm using VB 6.0 and ADODB.Recordset. As you know recordset is not a collection so that I can bind the records index number directly. If I am doing something wrong, please help me out to solve the problem. Please give any example of VB 6. how to map the iItem with records index number. Previously I was using FlexGrid, which took 10.xx seconds to process just 4105 entries where as your awesome HyperGrid took only 0.72 seconds to process same 4105 entries. So its the most useful control for me right now. Please give me any example, I want to use it with VB6 and Oracle. Please do the favor and give an example, how to map the iItem with records index number. You mentioned that .MoveNext is not proper way, then please let us know the other way. Please Help.

(If this comment was disrespectful, please report it.)

 
11/12/2006 11:59:39 AMSteppenwolfe

Amol,
There are plenty of examples of how to create an indexed database, both here and on the internet. You have three choices, create a proper indexed database, write a query that fetches rows by their position in table, or use custom or hyper mode, and load data directly into list. Adodb may not have collection, but you can retrieve rows or array of rows from table by pos, you are just going to have to do a little research and figure out the rest..
(If this comment was disrespectful, please report it.)

 
11/20/2006 6:28:24 AMSajey

Stephan, thanks for the effort to make it perfect..thanks again..
(If this comment was disrespectful, please report it.)

 
12/3/2006 7:59:39 AMGuy DETIENNE

Really a great work.
Many thanks!
(If this comment was disrespectful, please report it.)

 
12/7/2006 10:10:44 PMEduardo

bug:
try to create a column with any text (with the control compiled in ocx)

its wrong, not text in the column when the hyperlist its compiled.

sorry for my bad english hehehe.

PD: good work, greater SysList !
(If this comment was disrespectful, please report it.)

 
12/8/2006 9:33:28 AMSteppenwolfe

Eduardo,
Can you email me a screenshot and line of code you are using?
(If this comment was disrespectful, please report it.)

 
12/11/2006 2:33:55 PM

Is there something wrong with this code :

'Begin
Private Sub Command1_Click()
With ucHyperListNG1
.ItemAdd 0, "Num1", "One", -1, -1
.ItemAdd 1, "Num2", "Two", -1, -1
End With
End Sub

Private Sub Form_Load()
With ucHyperListNG1
.ColumnAdd 0, "Num", 40, ColumnCenter
End With
End Sub

'End

Because it keeps adding a null Row every time i click on Command1..


(If this comment was disrespectful, please report it.)

 
12/12/2006 3:23:27 AM

i used the last update and the code above worked fine ..

Many thanks for this control.. and indeed you are one of the best vb Developers..i 've ever seen

i 'll read the documentation and study your code to get the whole benfit

(If this comment was disrespectful, please report it.)

 
12/13/2006 8:56:31 PMSteppenwolfe

I'll look into it on the weekend. I am making a grid right now, so am a little busy ;o)
Stay tuned..
(If this comment was disrespectful, please report it.)

 
12/14/2006 6:47:07 PMMartin

It looks fantastic, but where can I find the Hyperlist documentation ??
(If this comment was disrespectful, please report it.)

 
12/14/2006 9:52:34 PMSteppenwolfe

Martin,
there are 8 pages of notes in the header, comments throughout, and 4 example projects, is this not enough?
As to previous comment (no-name). This is improper method in adding items. When you are clicking command1 repeatedly, you are adding same 2 items to list each time. In ItemAdd X, the X is the items index number.
(If this comment was disrespectful, please report it.)

 
12/15/2006 4:47:46 AMMartin

thanx, now i found it!!
(If this comment was disrespectful, please report it.)

 
12/16/2006 7:58:47 AMMartin

Hi Steppenwolfe,

I hope that you have time to read & answer this:
I have read the documentation but stil i can't figure out how it works. I have experience with simple programming in visual basic, but not with modules, classes, api, vb-groups etc. There are some many files included, it looks like chaos to me. Can you please tell me which files and subs/functions I should include when I start a NEW project?

And you explained before how to add items/subitems, but that's also abracadabra to me.

Let's say I open a textfile. How to add each line to the listview?

And last question: I have tried to compile grpTest.vbg to a .EXE file, but I got an error. Why is that? I don't want problems in the future when I compile my project that uses your virtual listview.

Many thanks in advance for your reply and sorry that i'm a newbie into this. But again it looks great and I really want to use it into my own vb-program(s).

Martin
(If this comment was disrespectful, please report it.)

 
12/17/2006 9:51:06 AMSteppenwolfe

Martin,
Basic usage is not all that different from a standard listview. You add the columns, link imagelist, then add items/subitems. Look at frmMethods example for simplified methods.
Error on compile is project file has compiled guid of control in it, I will fix it and update it lator.
(If this comment was disrespectful, please report it.)

 
12/18/2006 3:17:01 PMSteppenwolfe

Martin,
As for compiling. It is very simple. Open the group project. In the project explorer window, highlight the user control. Then File > Make nsplst.ocx
That will make the usercontrol, which is all you need for a project. Make sure to read the notes on compile switches, and rename the ocx as per the instructions.
Update goes up today with a couple small fixes.
Grid control should be out in January, it will be worth the wait.. ;o)
(If this comment was disrespectful, please report it.)

 
12/19/2006 6:48:38 AM_Merlin_

Step, You made me curious about the gridcontrol... ;) I'll be back (to check that one out)

Merlin is the name, and logic is my game...
(If this comment was disrespectful, please report it.)

 
12/19/2006 8:50:09 AMMartin

Steppenwolfe, you made my day! I got it all working now! Thanks a lot for your help and good luck with your future projects!
(If this comment was disrespectful, please report it.)

 
12/20/2006 9:51:38 AMAhmedQatar

Five stars!!!!!!!!!
(If this comment was disrespectful, please report it.)

 
12/24/2006 7:07:48 PMMartin

hmmm...i think i discovered a little bug. If i click on a column it will be sorted. So fas, so good. But if I do a search with Find after this, the find-function will find wrong items because it returns the row how it was in the situation before sorting.

Also rarely when the list is displayed after initializing, it shows the columns with a width of 1 character. Even when I initialized the width of each column. Very strange, but luckely it happens not often... :-S
(If this comment was disrespectful, please report it.)

 
12/29/2006 5:36:05 PMJuanito Dado Jr

I got an error "Out of Stack Space" when I loaded 1 million items and set to view icon. OMG, it's fast! Anyway, who cares! I'll give you my f***ing 5 stars!!!
(If this comment was disrespectful, please report it.)

 
1/1/2007 8:44:21 AMMr.Intermediate

GREAT code!!! it really help me.. tnx 5 for me
(If this comment was disrespectful, please report it.)

 
1/4/2007 6:22:37 AMTai Chi Minh Ralph Eastwood

Sweet stuff :D
(If this comment was disrespectful, please report it.)

 
1/4/2007 7:36:17 AMMartin

Thanks for the update Steppenwolfe!!!
(If this comment was disrespectful, please report it.)

 
1/6/2007 3:24:20 AMenmity

do u really really really really really mean the FINAL? ;)
(If this comment was disrespectful, please report it.)

 
1/7/2007 6:06:25 AMT Jackson

I think this might be the biggest project on PSC. Almost a meg of code. $%^&*( !!! Serious question that requires a serious answer. How long did this take you to do?
(If this comment was disrespectful, please report it.)

 
1/26/2007 3:49:24 AMRobert

Hi! There's no documentation in the zip file. Any chance to get some info, how-to? Property list, Events, etc...
(If this comment was disrespectful, please report it.)

 
1/26/2007 4:19:54 PMSteppenwolfe

Robert,
There are five pages of notes, and hundreds of comments in uc header, and four working examples.
(If this comment was disrespectful, please report it.)

 
2/5/2007 11:42:34 AMaolingo

what is "iconspaceX" and "iconspaceY" properties?
(If this comment was disrespectful, please report it.)

 
2/6/2007 9:36:42 AMSteppenwolfe

aolingo,
Those properties are left over from a previous revision, and can be removed.
(If this comment was disrespectful, please report it.)

 
2/8/2007 9:32:57 AMaolingo

Thanks your reply.Steppenwolfe.
and How can i off the option 'icon viewing each columns' ?
I mean the icons in the first columns in reportmode.
(If this comment was disrespectful, please report it.)

 
2/8/2007 11:13:42 AMaolingo

i found bug.
....

for i = 0 to 10
for k = 0 to 10
with list
.ItemAdd .count "", Text1,6,3
end with
next
next
.....

The list did not show any items .
just blank lists....
...


(If this comment was disrespectful, please report it.)

 
2/8/2007 11:54:34 AMaolingo

Sorry, i mean the subitems..
...

For k = 0 To 3
For i = 0 To 3
with list
.ItemAdd .Count, "", .Count, 3, 3
.SubItemsAdd .Count, 1, "subitem 1"
end with

Next
Next

The list shows 16 items and 4 subitems not 16.
Did I mistake?
(If this comment was disrespectful, please report it.)

 
2/18/2007 10:45:52 PMDon

Wow, really good stuff here, thank you. Works great for Btrieve extended fetch routines. Just a suggestion, change ItemTopIndex to Property Get/Let;

To set:

Property Let ItemTopIndex(lIndex As Long)
'/* set first list item index
' DEB: Added Property Let
If Not (m_lLVHwnd = 0) Then
Dim lCount As Long
lCount = SendMessageLongA(m_lLVHwnd, LVM_GETITEMCOUNT, 0&, 0&)
If (lCount > 0) And (lIndex < lCount) Then
' Set last item visible
If ItemEnsureVisible(lCount - 1) Then
' This ensures the one we want is on top
ItemEnsureVisible lIndex
End If
End If
End If
End Property
(If this comment was disrespectful, please report it.)

 
5/19/2007 5:39:19 AMkibe

any1, please help modify event at eHItemClick - vbRightButton. I very need use clicks are separatelly. RightClick and LeftClick.
(If this comment was disrespectful, please report it.)

 
5/20/2007 10:43:42 AMkibe

sorry, i mean, what i need add event MouseDown. How i can catch which button are pressed?
(If this comment was disrespectful, please report it.)

 
8/9/2007 7:06:21 PMJohn Owen

Hey Steppenwolfe
5 stars - best so far!!!
Can we use this in commerical apps? - no point reinventing the wheel :> it works perfectly. All the best.

(If this comment was disrespectful, please report it.)

 
8/20/2007 12:40:12 PMSteppenwolfe

You can use this in whatever commercial app you like abiding by the useage code described in uc header.
(If this comment was disrespectful, please report it.)

 
8/26/2007 12:47:44 PMPlanethax

I am trying desparately to have 2 subitem colums use Icon or Images but with no luck
'/* load a start item
With ucHyperListNG1
.ItemAdd 0, "", "TestItem 0", 3, 3 'no icon or image
.SubItemsAdd 0, 1, iml16.ListImages.Item(1).Picture

.SubItemsAdd 0, 2, iml16.ListImages.Item(2).Picture
End With
Some on please help, I do not get icon or image, just numbers?
(If this comment was disrespectful, please report it.)

 
8/27/2007 12:53:57 PMSteppenwolfe

Planethax, answer is in the example code.
Icon param is index number, not image handle.. add the images to list iml as demonstrated, then:
.SubItemImages = True
.SubIcon column, icon index -OR-
SubItemsAdd index, column, icon index
(If this comment was disrespectful, please report it.)

 
8/31/2007 10:33:37 AMPlanethax

I am sure all my answers are in example, I am noob and trying to learn, I have tried many different ways the past 2 weeks with no luck, I must be missing something somewhere else? this just puts a number in the colomn?
" .ImlSmallAddIcon iml16a.ListImages.Item(1).Picture
.InitImlSmall ' 32, 32
.InitList 0, 2 '<- 0 items, 2 subitem columns

.SubItemImages = True


'/* add columns
.ColumnAdd 0, "Continuous Monitoring Tests", (lX / 1.222), ColumnLeft, -1, SortAuto
.ColumnAdd 1, "S", (lX / 12), ColumnLeft, -1, Icon + 1
.ColumnAdd 2, "C", (lX / 12), ColumnLeft, -1, SortAuto

.ItemAdd 0, "", "Misfire", 1, 1
.SubItemsAdd 0, 1, 1
.SubItemsAdd 0, 2, ""
.SubIconIndex 1, 2, 2"
(If this comment was disrespectful, please report it.)

 
9/7/2007 2:26:59 PMm.sarul

very excellent thank's a lot good work....
(If this comment was disrespectful, please report it.)

 
9/13/2007 12:57:28 AMPlanethax

Steppenwolfe
Can you help me out where I am going wrong here?
Thanx
(If this comment was disrespectful, please report it.)

 
9/13/2007 11:06:36 AMSteppenwolfe

Planethax, you are initializing imagelist after adding icons, (wrong order).
(If this comment was disrespectful, please report it.)

 
9/13/2007 11:44:12 PMPlanethax

Sorry complete noob here
lX = .Width / Screen.TwipsPerPixelX
.ListMode = eCustomDraw
.InitImlHeader
.ImlHeaderAddIcon iml16a.ListImages.Item(1).Picture
.ImlHeaderAddIcon iml16a.ListImages.Item(2).Picture
.InitImlSmall
.ViewMode = StyleReport
.InitImlLarge
.InitImlState
.ImlStateAddIcon iml16a.ListImages.Item(1).Picture
.ImlStateAddIcon iml16a.ListImages.Item(2).Picture
.LoadStateImageList
.InitImlHeader
.InitImlSmall
.InitImlSmall ' 32, 32
.InitList 0, 2 '<- 0 items, 2 subitem columns
.ImlSmallAddIcon iml16a.ListImages.Item(1).Picture

.ColumnAdd 0, "Continuous Monitoring Tests", (lX / 1.222), ColumnLeft, -1, SortAuto
.ColumnAdd 1, "S", (lX / 12), ColumnLeft, -1, Icon + 1
.ColumnAdd 2, "C", (lX / 12), ColumnLeft, -1, SortAuto
.ItemAdd 0, "", "Misfire", 1, 1
.SubItemsAdd 0, 1, 1
.SubItemsAdd 0, 2, ""

(If this comment was disrespectful, please report it.)

 
9/14/2007 3:09:19 PMSteppenwolfe

Planethax,
each time you initilize the imagelist, you are emptying it. so for columns it is:
InitImlHeader
.ImlHeaderAddIcon iml16.ListImages.Item(1).Picture [etc]
.ColumnAdd 2, "C", (lX / 12), ColumnLeft, 1[this is icon index], SortAuto
State icons are for checkbox, large icons for tile view and small icons for report view.
.InitImlSmall
.ImlSmallAddIcon iml16a.ListImages.Item(1).Picture
.Add 0, "", "row 1", 0, 1
.SubItemCount = 2
.SubItemsAdd 0, 1, "field 1
.SubItemsAdd 0, 2, "field 2"
(If this comment was disrespectful, please report it.)

 
9/28/2007 2:00:43 PMtonimaroni

excellent work. thx so much!!

question: how do i implement the MouseDown event or how can i get the information which button was clicked?
(see kibe's feedback) thank you in advance for a little comment.

(If this comment was disrespectful, please report it.)

 
9/29/2007 9:10:17 AMtonimaroni

excellent work. thx!! same problem as kibe. how do i implement the mousedown event to differ left vs. right button click's? tank you for a short answer.
(If this comment was disrespectful, please report it.)

 
10/2/2007 9:01:37 AMPlanethax

I must be a DOLT, I still cant get this.
.Add 0, "", "row 1", 0, 1 ' Error Method or datamember not found.
If you could email me at Shop@planethax.com would be great, what I am trying to do is for example
3 columns, 2 rows, at loading, row1 column 1 has text, column 2/3 have icon1, then click button and column 2 now has icon2.
Thank you again, and sorry for being a pain, this is a bit sophisticted for me.
(If this comment was disrespectful, please report it.)

 
10/2/2007 9:07:04 AMSteppenwolfe

Toni,
2 choices: add getasynckeystate inside event return to get key code, or add new param to event w/ same.
(If this comment was disrespectful, please report it.)

 
12/28/2007 8:41:07 AMJorge Colaccini

What are the conditions to enable sorting when click on headers columns?
(If this comment was disrespectful, please report it.)

 
3/6/2008 3:48:10 PMErick Kalangit

hi,i got error when try to compile,like this;

User-defined:
Private m_cSelectorBar As clsStoreDc
Private m_cChkCheckDc As clsStoreDc
Private m_cChkUnCheckDc As clsStoreDc
Private m_cChkDisableDc As clsStoreDc


HOw to resolve this issue ?
(If this comment was disrespectful, please report it.)

 
9/13/2008 3:54:59 PMCurt

at form load, how to enter unsorted data in a column and have it sorted automaticly when displayed without having to click on the header the first time ? thanks for any input.
(If this comment was disrespectful, please report it.)

 
1/8/2009 2:26:21 AMnik

very excellent work
can you add alingment right to left for any cell i choose.
would be even more great.
(If this comment was disrespectful, please report it.)

 
3/17/2009 1:44:02 PMsunson

sorted after, set subitemtext not equl
get subitemtext
(If this comment was disrespectful, please report it.)

 
3/17/2009 1:53:48 PMsunson

BUG:
After you sort, subitemtext setting and getting the value of the different
(If this comment was disrespectful, please report it.)

 
3/17/2009 1:58:54 PMsunson

bug:
After you sort, subitemtext setting and getting the value of the different.
(If this comment was disrespectful, please report it.)

 
3/25/2009 6:20:17 PMsunson

please add event
mousedown mousemove mouseup

have selectedcount prep.
not have selectedindex prep.

sorted have bug
(If this comment was disrespectful, please report it.)

 
3/27/2009 2:54:02 AMGeorge

Great Control and 5 for me!! however I encounter some bugs after compiling. When I click the column to sort it exit the application using XPManifest the if will disable it then it will work. I need the XPManifest for the other control like textbox and combox etc. It will be more cool if you can incorporate to all control :D Anyway a really nice code!!! keep up the good work!!
(If this comment was disrespectful, please report it.)

 
3/29/2009 9:14:44 PMsunson

sorted bug:

Private Sub Command2_Click()
Dim j As Long
With ucHyperListNG1
' .SubItemsEdit = True
.ItemsSort 0, True
.SubItemText(3, 4) = "Modify 11"
.SubItemText(5, 1) = "Modify 31"
.ListRefresh
msgbox .SubItemText(3, 4)

End Sub
(If this comment was disrespectful, please report it.)

 
3/31/2009 12:12:17 AMGeorge

One more bug:
When I run throught vista the column header title shows only the first character. E.g. Company Name it shows only "C"?
Please fix this please I already decided to use this but now Im stuck again whether I will continue or not:-( please email me when fixed @ georgeoro@gmail.com
Thank you in advance.
(If this comment was disrespectful, please report it.)

 
7/10/2009 3:41:30 AMDigiRev

I've had quite a few bugs using this (along with your other submissions) which is a shame because otherwise, they would be really good. But, unfortunately, that makes them unusable for me.

Property pages would have been a good bonus too.
(If this comment was disrespectful, please report it.)

 
1/15/2010 3:21:47 PMSteppenwolfe

DigiRev -that is why we publish source code, to teach, and so you can fix issues using your implementation, maybe you just don't want to learn anything?
(If this comment was disrespectful, please report it.)

 
6/10/2010 4:14:10 AMDigiRev

There's not really much left to learn (for me) as far as VB6 is concerned, I mainly come here to hopefully save myself some time from reinventing the wheel.

That's why we publish source code, right?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.