Solved

How do I lock Listview column widths/headers?

Posted on 1998-12-08
7
459 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

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!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 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