I'm a noob to the .net world and I was wondering how I would go about creating a rich text box by triggering a click event button. I am trying to shrink the data currently in my form. One way of doing this would be to take away the two rich text boxes I have drag/dropped into the form and just adding a button. When the button is clicked, a rich text box will pop up. Any guidance will be greatly appreciated.

do:

Private rtb1 As RichTextBox
Private Sub button1_Click(sender As Object, e As EventArgs)
    rtb1 = New RichTextBox()
    rtb1.Name = "rtb1"
    rtb1.Size = New Size(300, 200)
    'set it
    rtb1.Location = New Point(20, 20)
    'set it
    Me.Controls.Add(rtb1)
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.