Public Class Form1 Public square As Integer = (Convert.ToInt32(txtSquare.Text) - 1) Dim rooster(square, square) As Label Dim oldrooster(square, square) As Label Public clickEnabled As Boolean = False Public Sub btnOrde_Click(sender As Object, e As EventArgs) Handles btnSquare.Click Dim message, title As String Dim defaultValue As Integer Dim userInput As Object 'Bericht op scherm. message = "Geef de hoogte van je spelbord in. (vb. 4 voor een 4x4 vierkant)" 'Titel scherm. title = "Initialisatie spelbord" defaultValue = 4 'Standaardwaarde. ' Geef bericht, titel, en standaardwaarde. userInput = InputBox(message, title, defaultValue) 'Als er wordt geannuleerd of als input kleiner is dan 2, dan blijft de hooghte de standaardwaarde (4). If userInput = "" Then userInput = defaultValue If Not userInput > 1 Then userInput = defaultValue square = (Convert.ToInt32(userInput) - 1) txtSquare.Text = Convert.ToInt32(userInput) End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)