Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking hidden listview columns 1

Status
Not open for further replies.

wm2005

Programmer
Apr 7, 2005
21
GB
Does anyone have a clever idea on how to easily lock a listview column?

Obviously setting its width to 0 will hide it, but still allow the user to resize and see its contents.

Any help most appreciated.

Will
 
This is not a clever/access idea. But Subclassing & VB.
It is working in Access.
Paste the first part in a module and
Code:
   gHW = ListView1.hwnd
   Hook
in the load event of the form.
alter the select case in the module as per your columnheader

________________________________________________________
Zameer Abdulla
Help to find Missing people
You may be the boss' pet; but you are still an animal
 
Thanks Zameer. That works, though will need some tweaking to make it usable on multiple listboxes where the hidden/locked columns are more than first two. I guess I could use the Tag property for this.
Will
 
Be careful of the use of intellimouse(Scroll mouse) on the listview when you are running this code. Access stops responding.

________________________________________________________
Zameer Abdulla
Help to find Missing people
You may be the boss' pet; but you are still an animal
 
Its true, this is a little unstable.

I suppose the other solution would be to store an array of values taken from the database, and only populate the fields I want displayed in columns on the listview. Thereby interacting with the array instead of the control for getting at record IDs etc. (just talking out loud here). Then sorting could also be done on the arrays, but all thats a load more coding :(

Will
 
I am just doing experiments with ListView. I will post if I find anything interesting

________________________________________________________
Zameer Abdulla
Help to find Missing people
You may be the boss' pet; but you are still an animal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top