[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Show Hint every Time the Mouse Moves

Posted on 2001-06-14
8
Medium Priority
?
581 Views
Last Modified: 2010-08-05
Hi!
I have a Listbox with some entrys. Now I want that everytime the user moves the mouse over a new entry a hint pops up and displays the whole content of the item of the listbox. (Like in the windows explorer, when a Filename is too long. I want exactly this).

The code i have so far just changes the hint property of the Listbox, but the hint is only displayed once, when the user enters the Listbox with the mouse, but no more when he moves it. I have to go out with the mouse every time, then a new Hint is displayed.

This is the code I have so far:

procedure TForm1.lb2MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var temp:integer;
begin
  with Sender as TListbox do begin
    temp:=ItemAtPos(Point(X, Y), true);
    if temp=-1 then begin
      Hint:='';
    end else begin
      Hint:=Items[temp];
    end;
  end;
end;

--

There is a second problem in my project: I need to display a directory structure, best with a treeview and a listview like the windows explorer. The only solution i've found are the win3.1 Components (Filelistbox,...) Is there a better way to realize this?

Please help!
Shellman
0
Comment
Question by:Shellman
[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
8 Comments
 
LVL 4

Expert Comment

by:DMN
ID: 6191157
Here is the simple sample:

procedure TForm1.ListBox1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var temp:integer;
begin
 with Sender as TListbox do begin
   temp:=ItemAtPos(Point(X, Y), true);
   if Temp>=0 then begin
     Hint:=Items[temp];
     Application.ActivateHint(Listbox1.ClientToScreen(Point(X,Y)));
   end;
 end;
end;
0
 
LVL 2

Expert Comment

by:FrodoBeggins
ID: 6191364
There is a hint listbox (THListBox) which you can use. Written by Alexandre GUILLIEN (AGuillien@csi.com)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6191476
You could also use TTreeView
(with a bit property adjustments it looks like a listbox and
you have the hint bahaviour as you want)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Shellman
ID: 6191490
Hi again!
It works fine, thanks!
Do you possibly have a solution for my second problem? Is there a better way to select a file, then the Win3.1 Controls?
0
 

Author Comment

by:Shellman
ID: 6191512
I used the sollution of DMN. This works great. It's easy and exactly what I wanted. I don't want to exchange my listbox and the hint listbox is too much work ;)

Shellman
0
 
LVL 4

Expert Comment

by:DMN
ID: 6191675
LMD library (www.lmd.de) has Shell components. Also available some free shell component sets. Try to find it at www.torry.net
0
 
LVL 4

Accepted Solution

by:
DMN earned 400 total points
ID: 6191698
Oh! I forget... Take a look at VIRTUALLISTVIEW.DPR in your Delphi\Demos\Virtual Listview folder. That should help!
0
 

Author Comment

by:Shellman
ID: 6191916
Thanks! Your two comments really helped me.
Now everything works quite fine.

Shellman
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

649 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