0
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
    If ListBox1.SelectedItem IsNot Nothing Then
        Timer1.Enabled = False
    Else
        Timer1.Enabled = True
    End If
End Sub

Edited by gozo12: edit

2
Contributors
3
Replies
4
Views
4 Years
Discussion Span
Last Post by Jx_Man
0

i tried this but its always gives false reslut please help me D:

        If ListBox1.Items.Count > 0 Then
            Me.Text = "i select empty part of listbox = falsee"
        Else
            Me.Text = "true"
        End If
0

You mark this thread as solved but you ask a help??

but it always make timer1.enalbe true

Your first code is working. you just need select the item on listbox to get timer enable as False.

i tried this but its always gives false reslut please help me D:
If ListBox1.Items.Count > 0 Then
Me.Text = "i select empty part of listbox = falsee"
Else
Me.Text = "true"
End If

I don't get what you want in your second code. If your listbox is fill with an items then this code will always return False. Even you select an empty part of listbox.

Edited by Jx_Man: add quote

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.