?
Solved

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

Posted on 2000-03-22
3
Medium Priority
?
229 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 20 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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 viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses
Course of the Month11 days, 6 hours left to enroll

752 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