Solved

How to set Focus For text only ?

Posted on 1998-05-07
2
161 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
  • 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now