Public Class Form1 Private Sub btnShowForm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowForm.Click Dim dialog As New Form2 If dialog.ShowDialog(Me) = vbOK Then txtHTML.Text = txtHTML.Text.Replace("ここ", dialog.txtTitle.Text) 'それとも、下のような方が目的にかないますか? 'txtHTML.Text = "<title>" & dialog.txtTitle.Text & "</title>" End If dialog.Dispose() End Sub End Class
Public Class Form2 Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click 'プロパティウィンドウで事前に設定しておけばForm2側は1行もプログラムは必要ない Me.DialogResult = vbOK End Sub End Class