Solved

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

Posted on 2000-03-22
3
183 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now