473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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

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

Gerry.

May 3 '06 #1
7 1383
<ge***********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
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
May 3 '06 #2
> 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.
br**********************@hotmail.com
Remove only "_nos_pam"

May 3 '06 #3
Hi Bruno,

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

May 3 '06 #4
<ge***********@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
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
May 3 '06 #5
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...

May 4 '06 #6
<ge***********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
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
May 4 '06 #7
ge***********@gmail.com wrote:
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
May 4 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jon Ripley | last post by:
Using VB6 (for two weeks!) I could get a ListBox search working perfectly but with a ListView it has completely stumped me. I've not found any previous posts that have helped :( The user...
1
by: SlantyOD | last post by:
Hi All, I'm trying to tie two ListViews together so that when the user scrolls one, the other stays 'in sync'. Since there are no OnScroll events, and the scroll bar position is unavailable,...
2
by: Gary Brown | last post by:
Hi, How do you programmatically scroll a ListView control horizontally? (The same effect as if the user used the horizontal scroll bar,) I've done it in C++/MFC, but can't find the means in C#. ...
1
by: youngie | last post by:
I've got a listview on a form in report style. It's populated with 40 item. I want to prevent the used clicking on some items, and if the user clicks on one of these items I want the selection to...
4
by: Steph. | last post by:
I have a List view displaying data in Detail mode with several columns. How I can get the column index the user clicked on ? (when user click on an item inside the ListView, not on a column...
7
by: aviad | last post by:
I am writing a Form application I need it to fit both resolution of 1600*1200 and 800*600 (and any other resolution that might jump in) the application is meant for regular PCs another question...
1
by: dvestal | last post by:
I have a ListView with checkboxes. I want to remove items when the checkboxes are unchecked, but to do so yields an ArgumentOutOfRangeException. Is there an easy way to get around this? A...
8
by: Lord Zoltar | last post by:
Hi, I've got a list view that displays a series of images. I'd like to be able to draw a divider across the list view to divide the images into groups. Ideally, I'd have a group name, with a line...
2
by: witpo | last post by:
Hi, I would like to display all listview items in one row with scroll bar below it – instead of multiple rows and scroll bar on the right. Someone told me that I can achieve it using...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.