An easy way would be to use a dialog form. Design your main form. Then design the form that will allow the user to enter the serial number.
1) Create a form with a Textbox to enter the serial number. Name the form SerialForm
2) In your new form, create a property
Public Property Serial As String
Get
Return Textbox1.text
End Get
Set(ByVal value As String)
TextBox1.Text = value
End Set
End Property
3) Put 2 buttons on the form. In the properties window, make Text = "OK" change DialogResult to DialogResult.OK
on the other button, change text to "Cancel" and Dialog Result to DialogResult.Cancel
4) Open your main window and in the form.load event put the following code
Dim checkSerial As Boolean = True
While checkSerial
Dim fm As New serialForm
If fm.ShowDialog = Windows.Forms.DialogResult.OK Then
If fm.Serial = "12345" Then checkSerial = False
Else
End
End If
End While
Now when you run your program with your main form as the start up, before it displays it will open a dialog form asking for the serial
There is a loop. If the user enters an incorrect serial, you main for reopens the dialog. If the serial is correct, the loop stops and your main
form continues to load. Of course you can send an incorrect message by using a label on the serialForm or you could use a message box if you wanted. You can also change the logic to check the serial. This is just a short example