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

but it always make timer1.enalbe true

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.