How to make a listview static .. .ie no user can use it.

  • Thread starter Thread starter gerry.brennan
  • Start date Start date
G

gerry.brennan

Is it possible to stop user from interacting /editing/ changing data/
changing look with a list view.

Gerry.
 
Is it possible to stop user from interacting /editing/ changing data/
changing look with a list view.

You'd probably be better off posting again in the user interface group:

microsoft.public.win32.programmer.ui

That said, there usually are at least two ways to do something like this.

One is to disable the control - check the docs for EnableWindow().

The other is to subclass the control - possibly subverting the handling of
keyboard and mouse input.

Regards,
Will
 
Is it possible to stop user from interacting /editing/ changing data/
changing look with a list view.


Hi Gerry,
Assuming you mean the .NET ListView control, you can simply set the Enabled
property to false.
that will prevent the user from interacting with it in any way.

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam"
 
Hi Bruno,

I have tried the enabled property ... how ever the items in the grid
change colour to a different colour.
 
I have tried the enabled property ... how ever the items in the grid
change colour to a different colour.

That's a visual cue to the user informing him that the control is disabled.

Regards,
Will
 
I want the listview control to "visually look the same" as an enabled
control,
But yet the use can not do stuff like edtit cells or resize
gridcolumns etc etc...
 
I want the listview control to "visually look the same" as an enabled
control,
But yet the use can not do stuff like edtit cells or resize
gridcolumns etc etc...

I understand. As I said, using the native API, you'd accomplish that by
subclassing the control.

Sorry, but I don't know what your .Net options are.

Regards,
Will
 
I want the listview control to "visually look the same" as an enabled
control,
But yet the use can not do stuff like edtit cells or resize
gridcolumns etc etc...

In .NET, set LabelEdit = false to prevent editing of item captions. I
don't think you can disable header column resizing, but you can disable
header click, and hide the header columns altogether, with the
HeaderStyle property. You can try to handle the MouseDown event, and if
the mouse is on top of a column, just discard the window message.

Actually I don't believe it's a good idea to disable header resizing --
your customers will hate you for that. It's like disabling the scrolling
of items. What if a caption is too long and the user has a wide screen
monitor, or they use a larger than normal font? You gotta allow such
basic operations.

Ultimately you can do anything by painting to the screen directly. Start
with a Panel control and paint whatever you wish on top of it.

Tom
 
Back
Top