Solved

How do I lock Listview column widths/headers?

Posted on 1998-12-08
7
457 Views
Last Modified: 2013-12-25
Damned if I can find it. I want to prevent the user from resizing column headers when a listview's in report view. This is because I use zero width columns to hold reference data (eg. customer primary key) and the user can access this by simply playing with the column widths. I want the listview to basically ignore user attempts to modify the column width. Help!
0
Comment
Question by:deal051298
  • 3
  • 3
7 Comments
 

Author Comment

by:deal051298
ID: 1488808
Edited text of question
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1488809
you can use a tricky way , by making the style of the listview  [ listview.view=2 ] is list, and use labels instead od headers.


0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1488810
A better solution for the 0 length columns is to use the tag property of Listitem object with a variant array

Dim x as string(4)
Dim li as listitem
x(1) = "Hello"
x(2) = "Othervalue"
.
li.tag = x


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:Mirkwood
ID: 1488811
I couldnot find any easy method to lock them.
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 200 total points
ID: 1488812
A better solution for the 0 length columns is to use the tag property of Listitem object with a variant array

Dim x as string(4)
Dim li as listitem
x(1) = "Hello"
x(2) = "Othervalue"
 
li.tag = x

0
 

Author Comment

by:deal051298
ID: 1488813
Thanks Mirkwood! Has been implemented. Still would like to lock the column headers but your quick response meant I could get on with this under a tight deadline! And it solves my "user seeing data they're not supposed to" problem!
0
 

Author Comment

by:deal051298
ID: 1488814
For future reference it should be noted that the syntax for the array I used was:
dim x(0 to 3) as variant //can be (3 to 30),(1 to 4) or whatever

the syntax Mirkwood gave me was incorrect. Also to retrieve the tag just use:

(whatever here).tag(1) //or 0,2,3 as the array permits
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question