Solved

only 5 pts left!!! Highlight line in list box

Posted on 2000-03-22
3
205 Views
Last Modified: 2010-04-02
I am using BorlandC++ Builder3.
I am using TListBox to display text and highlight each line of text individually one at a time.
I am trying to simulate stepping through code.
My problem is that I am using a button on the screen to highlight each line of text, this is working OK, but I want to disable the ability of the mouse and the up and down arrow keys  to highlight the lines. I have tried disablying the ListBox, but this greys out the text and disables the scrollbar which I want to use.
Can anyone help???

Thanks in advance

John
0
Comment
Question by:pcb69
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
RONSLOW earned 5 total points
ID: 2647342
one thought .. when the list box gets the focus, immediatlely set focus to your button.  That way, the list box can never recieve input focus and so you cannot move the selection up and down.  But that won't help with the mouse.

So I'd handle WM_KEYDOWN (move selection with keyboard arrow), WM_CHAR (move selection by typing letters), and WM_LBUTTONDOWN and WM_LBUTTONDLBCLK (change selection by clicking) and do not call the default processing (do nothing).
0
 

Author Comment

by:pcb69
ID: 2648480
Thanks Ronslow You have been very helpful. I would like to leave the question open so that I can get an answer to the mouse problem.

Thanks again for your help
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2648742
Handling the WM_LBUTTONDOWN and DBLCLK should solve the mouse as well (see second paragraph of my answer).

Anyway .. give it a go and see how you go.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

786 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