Solved

How to set Focus For text only ?

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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Technology stack suggestions 4 63
Question on web subscription for apps 3 107
WCAG audit tools 1 82
Where do I learn ES6? 3 68
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…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

772 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