くだすれVB6.0以前(超初心者向け) at TECH
[2ch|▼Menu]
710:デフォルトの名無しさん
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


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

4225日前に更新/174 KB
担当:undef