Solved

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

Posted on 2000-03-22
3
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

705 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