くだすれVB6.0以前(超初心者向け)at TECH
くだすれVB6.0以前(超初心者向け) - 暇つぶし2ch710:デフォルトの名無しさん
09/03/07 23:38:51
>>706
厳密にTopIndexが一つ変化するごとに確実にイベントが欲しい、
とかで無ければタイマ使ってポーリングしたら?
こんな感じのクラスを作って検証してみたが、悪くないように思うけど。

[ListBoxWatcher Class]
Private WithEvents mListBox As ListBox
Private WithEvents mTimer As Timer
Private mTopIndex As Integer
Public Event TopIndexChanged()

Public Property Set ListBox(lb As ListBox)
Set mListBox = lb
Dim frm As Form
Set frm = mListBox.Parent
If mTimer Is Nothing Then
Set mTimer = frm.Controls.Add("VB.Timer", "pollingTimer")
mTimer.Interval = 200
End If
If frm.ActiveControl Is mListBox Then
StartPolling
End If
End Property


次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch