P
philaphan80
I assume there's a way to do this since I've seen third-party
components act the same way.
How do I force the compiler to throw an error or warning message during
compile or build? For instance, if a certain property of my custom
component isn't set, how can I force my compile to fail -- and force me
to fix it before compiling successfully?
I've added some pseudo-code below for reference.........
Public Class MyClass
Inherits Control
Private _TestString As Label
<Browsable(True)> _
Public Property TestString() As String
Get
Return _TestString
End Get
Set(ByVal value As String)
_TestString = value
End Set
End Property
<pseudo-code>
If Me.TestString = "" Then
<This is where I'd want to throw the error during compilation,
forcing me to set TestString in the Properties window before I can
compile.......>
End If
</pseudo-code>
End Class
components act the same way.
How do I force the compiler to throw an error or warning message during
compile or build? For instance, if a certain property of my custom
component isn't set, how can I force my compile to fail -- and force me
to fix it before compiling successfully?
I've added some pseudo-code below for reference.........
Public Class MyClass
Inherits Control
Private _TestString As Label
<Browsable(True)> _
Public Property TestString() As String
Get
Return _TestString
End Get
Set(ByVal value As String)
_TestString = value
End Set
End Property
<pseudo-code>
If Me.TestString = "" Then
<This is where I'd want to throw the error during compilation,
forcing me to set TestString in the Properties window before I can
compile.......>
End If
</pseudo-code>
End Class