こんにちは、初心者SATOUです。
アドバイスを頂いたあと、色々しらべ以下のコードで
押す・離すの選択状態が変わるところまで何とかなったのですが
---
procedure TForm1.ListBoxItemMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
ClickInterval := 0;
Timer1.Enabled := TRUE;
end;
---
procedure TForm1.ListBoxItemMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
if ClickInterval < LONG_TIME then
begin
Timer1.Enabled := FALSE;
ClickInterval := 0;
end;
ListBox1.ItemIndex:=-1;
end;
---
procedure TForm1.Timer1Timer(Sender: TObject);
begin
ClickInterval := ClickInterval + 1;
if ( ClickInterval = LONG_TIME ) then
begin
Timer1.Enabled := FALSE;
ListBox1.ItemIndex:=-1;
end;
end;
---
procedure TForm1.ListBox1ViewportPositionChange(Sender: TObject;
const OldViewportPosition, NewViewportPosition: TPointF;
const ContentSizeChanged: Boolean);
begin
ListBox1.ItemIndex:=-1
end;
--
スクロールした時にViewportPositionChangeが発生するので
ここで選択を解除したいのですが
ListBox1.ItemIndex:=-1が効いていないようです。
毛利さんにアドバイス頂いた別のオブジェクトにフォーカスを当てても
選択は解除されませんでした。
よろしくお願い致します。
MLホームページ:
http://www.freeml.com/delphi-users
----------------------------------------------------------------------
【温泉】≪1泊2食付500円!?≫京都・軽井沢・南房総・箱根
・伊豆高原!!組数限定!特別価格!!【部屋数限り!】急いで!
◆大感謝プラン(1):【平日】 ¥500~
◆大感謝プラン(2):【土・連休】¥1,500~
http://ad.freeml.com/cgi-bin/sa.cgi?id=ngvds
------------------------------------------------------[freeml byGMO]--