The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
How...can i add controls to my form in a loop?
i'm trying to figure out how i can do something similar to this vb6 code in vb.NET
For i = 1 To 3
Load cmdPrev(i)
cmdPrev(i).Visible = False
cmdPrev(i).Left = cmdPrev(0).Left + (i * Maat)
cmdPrev(i).Top = cmdPrev(0).Top
Next i
this is just an example.... i could need this to do with some more controls...More than 3...
i know i can do this.... (from vb.net help)
' Visual Basic .NET
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Dim textBox1 As New System.Windows.Forms.TextBox
textBox1.Text = "Hello"
Me.Controls.Add(textBox1)
If Me.Controls.Count > 1 Then
MsgBox(Me.Controls(Me.Controls.IndexOf(textBox1)).Text)
End If
Me.Controls.Remove(button1)
End Sub
But...that's not exactly what i need....
i need to add the controls in a loop....
plz help :-)
Private Sub addtextboxes()
Dim x, i As Integer, startpos As Integer
x = 3
Dim txtCountryCur(x) As TextBox
startpos = Me.txtInput.Top + (Me.txtInput.Height * 1.5)
For i = 0 To x
txtCountryCur(x) = New TextBox()
txtCountryCur(x).Text = "test " & i
txtCountryCur(x).Left = 0
txtCountryCur(x).Top = txtCountryCur(x).Height * i + startpos
Me.Controls.Add(txtCountryCur(x))
Next
end sub