호기심 VB.net에서 내 프로그램을 디버깅 할 때 왜VB.net에서 개체 참조 오류가
Object Reference not set to an instance of the object.
그것은 내가 인해 라인이 오류가 발생하고 있다고이 오류를 받고 있어요에 관해서 4 및 5 :
Public Class Form1
Dim tSize
Dim S1 As String = ComboBox1.Text
Dim S2 As String = ComboBox2.Text
Private Sub FitContents()
tSize = TextRenderer.MeasureText(TextBox3.Text, TextBox3.Font)
TextBox3.Width = tSize.Width + 10
TextBox3.Height = tSize.Height
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = S1
TextBox2.Text = S2
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
Call FitContents()
End Sub
End Class
누군가 내가 왜이 오류를 받는지 설명하면 매우 감사 할 것입니다.
로 tsize 지정 유형이 없습니다. 이것은 의도적입니까? Option Strict가 켜져 있지 않은 것 같습니다. Option Strict On을 켜십시오. –