Option Strict On 'VisualBasic2008 Public Class Form1 Public Text_kakikomi As String Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown If e.KeyCode = Keys.Enter Then text_kakikomi = TextBox1.Text Me.Visible = False Form2.Show() End If End Sub End Class
Option Strict On 'コメント______VisualBasic2008 Public Class Form2 Private text_kakikomi As String Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Form1.Visible = True End Sub Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load text_kakikomi = Form1.Text_kakikomi TextBox1.Text = text_kakikomi End Sub End Class