要灵活:
Dim cmb As WinForm.ComboBoxcmb = e.Form.Controls("ComboBox1")
Dim match As booleanFor i AsInteger = cmb.SelectedIndex To cmb.Items.Count - 1 If cmb.Items(i) = "上海"Then cmb.SelectedIndex = i
match = True EndIfNext
If Match then
Return
end if
For i AsInteger = 0 To cmb.Items.Count - 1 If cmb.Items(i) = "上海"Then cmb.SelectedIndex = i
EndIfNext