slider

when app opens, it works
slide slider all the way to the right, 1things disappears, another appears
when you slide back left, NOTHING appears.
only when you are all the way to the right does the listbox appear
any ideas, thanks

[code]if Slider1.Value = 0 then
Listbox_ATP.Visible = true
Listbox_SAL.Visible = false
end If

if Slider1.Value = 1 then
Listbox_ATP.Visible = false
Listbox_SAL.Visible = true
end If[/code]

Use an else?

if Slider1.Value = 0 then Listbox_ATP.Visible = true Listbox_SAL.Visible = false else Listbox_ATP.Visible = false Listbox_SAL.Visible = true end If

an ELSE would infer a value not 0… which is all values of a slider except full left

how about if I have 20 listboxes, and 20 stops on the slider.
if 1, show 1
if 2, show 2
if 3 , show 3

this is what I would need

Are the listboxes individually named or part of a control set with a single name?

individually…I’m a newbie, not that knowledgeable yet

ATP goes invisible when I drag slider to 3 or back to 1…weird.

if Slider1.Value = 1 then Listbox_ATP.Visible = true Listbox_SAL.Visible = false else if Slider1.Value = 2 then Listbox_ATP.Visible = false Listbox_SAL.Visible = true else if Slider1.Value = 3 then Listbox_ATP.Visible = true Listbox_SAL.Visible = false end If end if end

There’s probably 5-10 different ways of doing this, the easiest and least “automated” would be a select case:

[code]'set all visible to false
Listbox_ATP.Visible = False
Listbox_SAL.Visible = False
'… add 18 more here

Select Case slider1.Value
Case 0
Listbox_SAL.Visible = True
Case 1
Listbox_ATP.Visible = True
Case 2
'… add 18 more here
End Select[/code]

If you wanted to do it using IF’s it would be like this:

[code]'set all visible to false
Listbox_ATP.Visible = False
Listbox_SAL.Visible = False
'… add 18 more here

If slider1.Value = 0 Then
Listbox_SAL.Visible = True
ElseIf slider1.Value = 1 Then
Listbox_ATP.Visible = True
ElseIf slider1.Value = 2 Then
'… add 18 more here
End If[/code]

The way you have it set up, Listbox_SAL only is visible when Slider1 has a value of 1. so unless you’ve restricted the slider to values of 0 and 1, Listbox_SAL won’t show up very often. If what you are trying to do is show Listbox_SAL when the slider’s value is not zero then change

if Slider1.Value = 1 then

to

if Slider1.Value >= 1 then

If you’re using this in iOS, Slider1.Value is a Double. Try:

Dim value as Integer = Slider1.Value
If value = 1 Then