Tabela de conteúdos

Descrição

Mostra um hint em um item de um ListBox

Implementação

Delphi

Esse código deve ser implementado no evento OnMouseMove do ListBox. A propriedade ShowHints deve estar como true.

O Items[lstIndex] determina o hint que aparecerá.

procedure TForm1.ListBox1MouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer) ;
 var lstIndex : Integer ;
begin
  with ListBox1 do
  begin
    lstIndex:=SendMessage(Handle, LB_ITEMFROMPOINT, 0, MakeLParam(x,y)) ;
    if (lstIndex >= 0) and (lstIndex <= Items.Count) then 
        Hint := Items[lstIndex]
    else
        Hint := ''
  end;
end;

Fonte: http://delphi.about.com/cs/adptips2001/a/bltip0201_4.htm

 
fnc_hint_item_listbox.txt · Última modificação: 2011/09/27 18:07 por denis.dantas
 
Exceto onde for informado ao contrário, o conteúdo neste wiki está sob a seguinte licença:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki