Solved

How to set Focus For text only ?

Posted on 1998-05-07
2
166 Views
Last Modified: 2013-12-26
Iam very much Thankful for your help and the speed at which you are doing this. At the last phase of my work
I want the click event to be handled by List Box i.e
when ever I click on the list box the Text associated with
the Bitmap should get Highlighted . Is there any way to do so . Iam sorry to Mr msmits the comment you have added
was already got by me yesterday only i.e I recognized the fault until the comment reached me. But at this phase
I should say you have become a part and parcel of my
Project Thank You very much.
0
Comment
Question by:kollipara
[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 Comments
 
LVL 3

Expert Comment

by:msmits
ID: 1299642
The thing here is that the ListBox itself keeps some information about which items are selected within the List. Be sure to turn LBS_MULTIPLESEL on as style to allow multiple selection, when you allow such in your listbox.
When you respond to the WM_DRAWITEM message to draw your 'Owner Drawn' information in the listbox, you can retrieve the status information about the item to be drawn from the structure. For example, the ODS_SELECTED status means that the internal listbox information signalled that the particular item must be graphically drawn in the selected state. What you could do, for example, is to draw the string text on a light Blue background by using the SetBkColor() function on the DC when drawing the item in the list box.
Handling the selection or the double click action can be done in two separate way, which have their advantages and dis-advantages:
1. You can handle the messages in your TListBox derived class. This has the advantage that the code for doing the ListBox things is quite together, but the disadvantage that you are putting your 'filemanager like' functionality in a more generic ListBox class.
2. You can handle the WM_COMMAND notification in the parent window of the derived ListBox class. The advantage is that the application functionality is at the place where it should be, but the disadvantage is that the listbox handling and specific code is spread over two source files and maybe even two header files.


0
 
LVL 3

Accepted Solution

by:
msmits earned 0 total points
ID: 1299643
Is my description satisfactory or do you need more?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

734 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