I have a Windows Form in a VB.NET program with a property of “TournID“. The ID will be passed in when the form is created by a button pressed.
Here is the property stub:
Private _TournID As Integer
Public Property TournID() As Integer
Get
Return _TournID
End Get
Set(ByVal value As Integer)
_TournID = value
End Set
End Property
What I would need help doing is when that form loads, if that property is set, to pull information from a database with a TournamentID‘s involving that TournID. Else, if TournID is not set, do nothing but show the form with blank textboxes or default values, etc.
You can create an overloaded constructor that allows you to either create a new (empty) tournament, or load an existing tournament:
You can call it two ways:
Something like this: