You code is incorrect. First, if N > 0, the index i should start from 0, not 1. Second, you should move ComboBox1.Items.Add("No TWAIN devices found") to else clause. Here is how I changed your code logic with
Dynamic .NET TWAIN SDK[
^]:
dynamicDotNetTwain.OpenSourceManager()
Dim N As Long
Dim i As Long
N = dynamicDotNetTwain.SourceCount
If N > 0 Then
ComboBox1.Items.Clear()
For i = 0 To N
Name = dynamicDotNetTwain.SourceNameItems(Convert.ToInt16(i))
ComboBox1.Items.Add(Name)
i += 1
Next
Else
ComboBox1.Items.Add("No TWAIN devices found")
End If
ComboBox1.SelectedIndex = 0