473,651 Members | 2,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to disable the checkbox in the listview

Hi,

I use checkbox in the listview, sometime, I want to disable these
checkboxes, any body knows how to do so?

Thanks advance
Mar 7 '06 #1
1 6514
Handle the ItemChecked or ItemCheck event and set the NewValue back to the
CurrentValue in the supplied event args, i.e.:

Private Sub ListView1_ItemC heck(ByVal sender As Object, ByVal e As
System.Windows. Forms.ItemCheck EventArgs) Handles ListView1.ItemC heck
If e.Index = 0 Then
e.NewValue = e.CurrentValue
End If
End Sub

This will effectively prevent the user from changing the value
/claes
"Li Pang" <Li****@discuss ions.microsoft. com> wrote in message
news:F5******** *************** ***********@mic rosoft.com...
Hi,

I use checkbox in the listview, sometime, I want to disable these
checkboxes, any body knows how to do so?

Thanks advance

Mar 8 '06 #2

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

Similar topics

2
9732
by: HolaGoogle | last post by:
Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another one is "number" field. To display the yes/no field in my asp form i use a checkbox and fot he other field i use a normal text box. if the yes/no field is checked then the other field is enabled otherwise it has to be disabled.Here's what i've done so far: Do While Not ObjRS.EOF <td><input...
2
7729
by: Terrance - all2know2001 | last post by:
How can I assign a checkbox to a listview ? I'm reading data from a foxpro table and one of the fields contains a 1 or 0. I would like for all 1's to show a checked checkbox in the listview. How do I get the checkbox in the listview? Thanks.
0
1670
by: Nathan M | last post by:
Hi, In a listview with the View set to "Details" and CheckBox = True, is it possible to get the CheckBox to be centered vertically? The font size in my listview is 14, which increases the size of each row in the listview, but the checkbox remains in the upper-middle. Thanks, Nathan
4
10407
by: Matrixreloadedth | last post by:
How to change disable color of Checkbox??? I have a checkbox with forecolor in red but when i disable by set Enable properties to false forecolor is changed to gray color but i don't want it. how to make disable color as the same before set enable = false Anyone can help me?????
0
1524
by: Li Pang | last post by:
Hi, I want to know how to disable some of checkbox in a listview programatically. thanks
3
2522
by: =?Utf-8?B?QnJldA==?= | last post by:
I am a VB Developer w/ SQL Server experience breaking into web world via the Visual Web Developer Express. I've already set up my data sources to my SQL Server tables and have created a grid view of my tables which executes successfully. Two of the fields in the gridview are checkboxes that are bound to a table, datatype is "bit". These 2 fields are "APPROVED" or "DENIED", in other words, the user needs to check approve or deny a record....
5
11270
by: masterej | last post by:
Developers, Is there any way to disable all checkboxes on a form? I have a form with 160 checkboxes and I want to be able to disable all of them. Is there a way I can do something like this: for (int i = 0; i < 160; i++) { string checkbox = "checkBox" + i.toString(); (Cast)checkbox.enabled = false;
6
5535
by: Brandon McCombs | last post by:
Hello, I have a form that contains a listview on the left side and a column of buttons on the right side. Only some of the buttons do I want enabled all the time. The other buttons should be enabled only if something is selected in the listview. That part specifically works but not very well. It seems that I can only get the buttons to disable if I click off the text of the items in the listview but still within about 10-20 pixels of...
3
2135
by: ewankosayo | last post by:
Listview Checkbox I populate here a listview and the checkbox property I set it to true so I can have a checkboxes on my listview. My problem is if I checked two checkboxes on listview it falls to MyButton.Enable = False Here’s what I wrote.. Private Sub MyListvView_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyListView.Click If (Me.MyListView.CheckedItems.Count - 1) = 0 Then Me.MyButton.Enabled = False
0
8349
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8795
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8576
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7296
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.