Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to set Focus For text only ?

Posted on 1998-05-07
2
Medium Priority
?
168 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to count occurrences of each item in an array.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

722 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