Public Class Form1 Private new_Textboxes() As TextBox = {} Private Sub CreateDynamicControls() Dim i As Integer = new_Textboxes.Length ReDim Preserve new_Textboxes(i) For Me.p = 1 To ListBox6.Items.Count For Each listboxitem In ListBox6.Items new_Textboxes(i) = New TextBox With new_Textboxes(i) .Name = "TextBox" & i.ToString() If new_Textboxes.Length < 2 Then .SetBounds(210, 8, 100, 20) Else .Left = new_Textboxes(i - 1).Left .Top = new_Textboxes(i - 1).Top + new_Textboxes(i - _ 1).Height + 4 .Size = new_Textboxes(i - 1).Size End If .Tag = i End With Me.Controls.Add(new_Textboxes(i)) Next listboxitem Next End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load CreateDynamicControls() End Sub Public Sub New() InitializeComponent() CreateDynamicControls() End Sub End Sub End Class
Dim time As String While True Select Case time Case "1:20" //do code Exit Select Case "12:20" //do code Exit Select End Select End While
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)