[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

TCheckListBox -

Posted on 1998-11-01
5
Medium Priority
?
245 Views
Last Modified: 2010-04-06
I am using a TCheckListBox with style lbOwnerDrawFixed. It displays drives with little pictures depending on the type of drive. It works great except that when the user clicks on the text/picture it draws a rectangle around it (sort of like to show the focus). I don't like it. I would like either one of the two following behaviours:

1 - when they click on the text/picture, behave as if the checkbox itself had been clicked and without the rectangle(my first choice)

2 - at least not get the rectangle.
0
Comment
Question by:sharons
[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
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1345351
sharons, why then don't you just use TListBox or TCombobox with lbOwnerDrawFixed? ZiF.

0
 

Author Comment

by:sharons
ID: 1345352
I do need the check boxes. I use this for the user to select the drives to be made available at a kiosk. This is part of the setup process.  Sorry if I was not clear.
0
 

Expert Comment

by:atze
ID: 1345353
why don't you use TListBox and a TImageList? Get the images you need and do the changes of the checkbox by your owne that's all.
0
 

Author Comment

by:sharons
ID: 1345354
Sorry, I don't understand your solution. Here is exacly what I do:

When users first use my program, they have to select one or many drives. So I loop from a to z and see which letters are valid drive. So I add an item in the TCheckListBox (with style lbOwnerDrawFixed). For each item I draw a little image and the drive letter. And of course the actual chack box is there beside each item (which is what I need). The user then checks all the desired drives. I then create a string with all the drive letters Ex: ACD and saves that to the registry.

My problem is that if the user clicks on the text or image (instead of the little check box) then one or more item gets a rectangle drawn around it as if it had the focus. This looks bad and this is what I want to get rid of. I do need the check boxes so why would I use a TListBox ? Maybe I am missing your point.

You can test what I mean by dropping a TCheckListBox on a form. Add a few items then click on the text. Whatever happens to the text is what I want to eliminate. It might just draw one rectangle at the time (I just realize that when I said rectangle you might have though I was talking about the checkbox itself, I am talking about a "Focus rectangle").
0
 

Accepted Solution

by:
atze earned 60 total points
ID: 1345355
You don't have to use TTreeView but if you don't like the Focusrectangle around your pictures this is one possible solution

Add a TTreeNode for every Drive and set the ImageIndex to the right Image in the ImageList (a checked and an unchecked checkbox in the ImageList plus your Drive images). You can now change the Image in the TreeView by changing the ImageIndex of the TreeNode.


0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

649 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