How should I write not greater than 0
in VB.NET?
psuedocode:
if 开发者_StackOverflow中文版x is not greater than 0 then
do something
end if
If something is not greater than something, then it is less than or equal to it. So x <= 0
.
if x is smaller or equal than 0 maybe?
if x <= 0
Would this not do for you? Simplest and easiest way of saying "Not greater than"
If it's not greater than 0, it's less than or equal:
If x <= 0 Then
...
End If
try this like
If Not ListBox1.SelectedIndex < 0 Then
'do something
Else
do some thing
End If
Try this
dim x as integer = -1
If x < 0 OrElse x = 0 Then
'Do something in here
End If
if value of x is less than 0 or equal to 0 but not greater than 0 it will trigger the 'Do something in here
You can just change the value of the integer x from -1 to anything you want
dim X as decimal
if x<0 then
end if
精彩评论