Create new project.

Add a button to your form, text: Create textbox.
Add a timer to your program.

The starting code is going to be very similar to the code at the end of the previous example (18). It's good to go through that example before going through this.

Double click the button to go the coding page. Before the button1 sub, declare this:
Private kk As Graphics
Private b1 As Integer
Private b2 As Integer
Private c1 As Integer
Private dd As Integer = 1

- "kk" is going to be used for drawing, "b1" and "b2" are going to be used for storing the location and size values, we'll use "c1" to help us switch between two different operations inside the same subroutine, "dd" we'll be used to raise the number inside present in the name of every newly created textbox.

Inside button1 sub add this:

kk = CreateGraphics()
AddHandler Click, AddressOf click1

Create the "click1" sub:
Sub click1(ByVal sender As System.Object, ByVal e As System.EventArgs)
b1 = PointToClient(Cursor.Position).X
b2 = PointToClient(Cursor.Position).Y
c1 = 1
Timer1.Start()
End Sub

- it collects the location values for our new textbox, and it starts the timer,

Go to the design page, double click on Timer1. Insert this inside:
Refresh()
kk.DrawRectangle(Pens.Black, b1, b2, PointToClient(Cursor.Position).X - b1, PointToClient(Cursor.Position).Y - b2)

- the timer is going to draw a temporary rectangle on the screen while we are still deciding the size of our new textbox. When we make the next click, we should return back to the "click1" sub. Add this at the beginning:
If c1 = 1 Then
Timer1.Stop()
Dim ff As New TextBox
ff.Name = "TextBox" & dd
ff.Multiline = True
ff.Location = New Point(b1, b2)
ff.Width = PointToClient(Cursor.Position).X - b1
ff.Height = PointToClient(Cursor.Position).Y - b2
Controls.Add(ff)
Refresh()
RemoveHandler Click, AddressOf click1
c1 = 0
dd = dd + 1
Exit Sub
End If

- on the second click the timer is stopped and a new textbox is created with the specified properties. The first textbox name is going to be: TextBox1. Refresh will remove the last drawn rectangle by the timer, the rectangle drawings were only used as a visual aid for the creation of the new object.
The "dd" variable is raised to be used for the following textbox name.

Code:

    Public Class Form1

    Private kk As Graphics
    Private b1 As Integer
    Private b2 As Integer
    Private c1 As Integer
    Private dd As Integer = 1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    kk = CreateGraphics()
    AddHandler Click, AddressOf click1
    End Sub

    Sub click1(ByVal sender As System.Object, ByVal e As System.EventArgs)
    If c1 = 1 Then
    Timer1.Stop()
    Dim ff As New TextBox
    ff.Name = "TextBox" & dd
    ff.Multiline = True
    ff.Location = New Point(b1, b2)
    ff.Width = PointToClient(Cursor.Position).X - b1
    ff.Height = PointToClient(Cursor.Position).Y - b2
    Controls.Add(ff)
    Refresh()
    RemoveHandler Click, AddressOf click1
    c1 = 0
    dd = dd + 1
    Exit Sub
    End If
    b1 = PointToClient(Cursor.Position).X
    b2 = PointToClient(Cursor.Position).Y
    c1 = 1
    Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    Refresh()
    kk.DrawRectangle(Pens.Black, b1, b2, PointToClient(Cursor.Position).X - b1, PointToClient(Cursor.Position).Y - b2)
    End Sub
    End Class


Add another button, text: Move textbox
Add another timer to the program.

For the next part of the program we'll need to add two more variables. Below this line:
Private b2 As Integer
add this:
Private b3 As Integer
Private b4 As Integer

Double click on button2 and add this inside:
kk = CreateGraphics()
Timer2.Start()

Double click on the second timer, insert this into the sub:
For Each i In Controls.OfType(Of TextBox)()
If i.Focused Then
b3 = i.Width
b4 = i.Height
AddHandler Click, AddressOf click2
c1 = Replace(i.Name, "TextBox", "")
Controls.Remove(Controls(i.Name))
End If
Next

After a person clicks the Move textbox button, he can proceed by choosing a specific textbox present on the form. Once a textbox was chosen, the blinking cursor is placed inside the textbox and it receives the program's focus. In order to find out which textbox is currently focused we used the "For" loop.
If i.Focused Then -> when we find which textbox is selected, then we take it's size and store it inside the "b3" and "b4" variables, we add a click event to the "click2" sub.
"c1" receives the number from the textbox name and, therefore, it becomes higher than zero.
Controls.Remove(Controls(i.Name)) - after we have taken the values we need from the chosen textbox, we remove it.

The previous data was taken in the first tick of the timer, we will now write inside the same sub what happens on all the following timer ticks. Since "c1" will necessarily be higher than zero at that moment, we'll use that in the code:
If c1 > 0 Then
b1 = PointToClient(Cursor.Position).X - b3 / 2
b2 = PointToClient(Cursor.Position).Y - b4 / 2
Refresh()
kk.DrawRectangle(Pens.Black, b1, b2, b3, b4)
Exit Sub
End If

- we are changing the location values of "b1" and "b2" of the rectangle during the "movement" of the textbox". The width and height get halved and are used to reduce the current mouse cursor location - this way, while we are transporting the control, the mouse cursor will be in the center of the rectangle rather than at the most top-left point.

Now we will add the sub called "click2". The first tick of the timer adds the mouse click event to this sub.
Add this below the second timer sub:
Sub click2(ByVal sender As System.Object, ByVal e As System.EventArgs)
Timer2.Stop()
Dim ff As New TextBox
ff.Name = "TextBox" & c1
ff.Multiline = True
ff.Location = New Point(b1, b2)
ff.Width = b3
ff.Height = b4
Controls.Add(ff)
Refresh()
c1 = 0
RemoveHandler Click, AddressOf click2
End Sub

- when you have decided the new location of your transferring textbox, the code of "click2" will be executed.
Timer is then stopped, "c1" will have the same name number of the textbox we have chosen. A new textbox is created with the specified attributes and everything is reset to the start: refresh cleans the form out of rectangles, "c1" is set to zero and the mouse event is removed from this sub.

Final code:

    Public Class Form1

    Private kk As Graphics
    Private b1 As Integer
    Private b2 As Integer
    Private b3 As Integer
    Private b4 As Integer
    Private c1 As Integer
    Private dd As Integer = 1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    kk = CreateGraphics()
    AddHandler Click, AddressOf click1
    End Sub

    Sub click1(ByVal sender As System.Object, ByVal e As System.EventArgs)
    If c1 = 1 Then
    Timer1.Stop()
    Dim ff As New TextBox
    ff.Name = "TextBox" & dd
    ff.Multiline = True
    ff.Location = New Point(b1, b2)
    ff.Width = PointToClient(Cursor.Position).X - b1
    ff.Height = PointToClient(Cursor.Position).Y - b2
    Controls.Add(ff)
    Refresh()
    RemoveHandler Click, AddressOf click1
    c1 = 0
    dd = dd + 1
    Exit Sub
    End If
    b1 = PointToClient(Cursor.Position).X
    b2 = PointToClient(Cursor.Position).Y
    c1 = 1
    Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    Refresh()
    kk.DrawRectangle(Pens.Black, b1, b2, PointToClient(Cursor.Position).X - b1, PointToClient(Cursor.Position).Y - b2)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    kk = CreateGraphics()
    Timer2.Start()
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
    If c1 > 0 Then
    b1 = PointToClient(Cursor.Position).X - b3 / 2
    b2 = PointToClient(Cursor.Position).Y - b4 / 2
    Refresh()
    kk.DrawRectangle(Pens.Black, b1, b2, b3, b4)
    Exit Sub
    End If

    For Each i In Controls.OfType(Of TextBox)()
    If i.Focused Then
    b3 = i.Width
    b4 = i.Height
    AddHandler Click, AddressOf click2
    c1 = Replace(i.Name, "TextBox", "")
    Controls.Remove(Controls(i.Name))
    End If
    Next
    End Sub

    Sub click2(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Timer2.Stop()
    Dim ff As New TextBox
    ff.Name = "TextBox" & c1
    ff.Multiline = True
    ff.Location = New Point(b1, b2)
    ff.Width = b3
    ff.Height = b4
    Controls.Add(ff)
    Refresh()
    c1 = 0
    RemoveHandler Click, AddressOf click2
    End Sub

    End Class


I hope everything written is clear.

It would be a good idea adding a Cancel button to this form and a label. The button would be invisible when starting the program. After the Create button is pressed, the label should change telling the user that the creation of the textbox is turned on and also the cancel button should appear too. If the cancel button was pressed, it would nullify everything that the Create button started. If you either choose to create a textbox or press the cancel button - then you have to make it disappear again and the label is reset to start.

The same thing should be done for the "Move textbox" button too.