Это будет примерно так:
Friend WithEvents Button1 As Button
Private Sub RichTextBox1_Click(sender As Object, e As EventArgs) Handles RichTextBox1.Click
Button1 = New Button ' Create new instance
Me.Button1.Size = New System.Drawing.Size(75, 23) ' give the button a size
Button1.Text = "My button" ' set the button text
Me.Button1.UseVisualStyleBackColor = True ' make it look windows like
Dim pos As Point = RichTextBox1.GetPositionFromCharIndex(RichTextBox1.SelectionStart) 'determine the button position
RichTextBox1.Controls.Add(Button1) ' get it inside the rich text box
Button1.Location = New Point(RichTextBox1.Right - Button1.Width, pos.Y + RichTextBox1.Top) ' set the button position
End Sub
Конечно, это не обязательно должно быть в событии Click, вы, возможно, можете использовать событие KeyPress, чтобы определить, нажал ли пользователь ввод, и затем вставить его.в таком случае.Также поиграйте с положением (переменная POS), чтобы изменить положение кнопки.
Nandostyle