小编Bab*_*k A的帖子

在Visual Basic.Net中添加零到零之间的区别?

为什么会有所不同?!

Public Class Form1
 Public Function MyFunction() As Integer?
    Return Nothing
 End Function

 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim o As Object = Me
    MsgBox(TypeName(Me)) ' Form1
    MsgBox(TypeName(o))  ' Form1
    MsgBox(TypeName(Me.MyFunction())) ' Nothing
    MsgBox(TypeName(o.MyFunction()))  ' Nothing
    ' but
    MsgBox(TypeName(Me.MyFunction() + 0)) ' Nothing
    MsgBox(TypeName(o.MyFunction() + 0))  ' Integer
 End Sub
End Class
Run Code Online (Sandbox Code Playgroud)

vb.net object nothing

6
推荐指数
1
解决办法
321
查看次数

标签 统计

nothing ×1

object ×1

vb.net ×1