Solved

How to set Focus For text only ?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Read XML Response From ASP Classic 9 66
Web Development Tools for MVC 3 75
Fixed div within Bootstrap carousel item 11 54
Download a website to hdd 2 48
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

932 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

14 Experts available now in Live!

Get 1:1 Help Now