473,396 Members | 1,785 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,396 software developers and data experts.

How to Draw Checkbox in ListView OwnerDraw

I'm using OwnerDraw for some customization in my ListView - adding
color to item backgrounds. I'm using the ListView specifically for
it's OwnerDraw capability. I originally was using the CheckedListBox
control but it has no OwnerDraw. I have not found a way to draw the
checkboxes while using OwnerDraw (the checkboxes appear correctly when
not using OwnerDraw). How can this be done? It would be nice if there
were something similar to e.DrawText().... like e.DrawCheckbox(). Oh,
and I'm using Visual Studio 2005 (Framework 2.0), which has an
OwnerDraw for ListView (older versions do not).

Thanks!

Jul 11 '06 #1
1 5041
Hi,

Take a look at the System.Windows.Forms.CheckBoxRenderer class.

HTH

<tm**@eclipse.netwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
I'm using OwnerDraw for some customization in my ListView - adding
color to item backgrounds. I'm using the ListView specifically for
it's OwnerDraw capability. I originally was using the CheckedListBox
control but it has no OwnerDraw. I have not found a way to draw the
checkboxes while using OwnerDraw (the checkboxes appear correctly when
not using OwnerDraw). How can this be done? It would be nice if there
were something similar to e.DrawText().... like e.DrawCheckbox(). Oh,
and I'm using Visual Studio 2005 (Framework 2.0), which has an
OwnerDraw for ListView (older versions do not).

Thanks!

Jul 12 '06 #2

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

Similar topics

3
by: Thomas Kehl | last post by:
Hi. Does anybody have a sample, how does I can make a checkBox ownerdrawn? I need to change the color inside of the box. Can anyone help me, how does I have to do this? Thanks Thomas
5
by: Brian Keating EI9FXB | last post by:
Hello there, Wonder can anyone point me in the correct direction? I would like to change the standard list view control so that i can have alternated rows in a different color, i.e. white grey...
2
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...
0
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...
0
by: Kevin Blakeley | last post by:
I noticed on the 2.0 version of the lsitview class that there is a new OwnerDraw property that allows you to take over for the rendering of the listview. If I override the DrawColumnHeader,...
1
by: tmda | last post by:
I'm using OwnerDraw for some customization in my ListView - adding color to item backgrounds. I'm using the ListView specifically for it's OwnerDraw capability. I originally was using the...
3
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...
1
by: GruBByMaster | last post by:
Hello I want to create a custom column header that i will later insert in a ListView. I just want to change to background color and font color in the header. Is this possible? I seen some...
7
by: azoapes | last post by:
Hello, I'm trying to prevent a listView from repainting when I change group assignments for the items. Let's assume I have two groups with 100 items in each and moves 100 items from group A to group...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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,...

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.