Dim AA As String = DataGridView1.CurrentRow.Cells("性別").Value.ToString If aa = "男性" Then aa = "0" Else aa = "1" End If
Private Sub DataGridView1_CellContentDoubleClick(sender As Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentDoubleClick Dim B As New FmB Dim DgA As String = DataGridView1.CurrentRow.Cells("年齢").Value.ToString Dim DgB As String = DataGridView1.CurrentRow.Cells("名前").Value.ToString Dim DgA As String = DataGridView1.CurrentRow.Cells("住所").Value.ToString Dim DgB As String = DataGridView1.CurrentRow.Cells("性別").Value.ToString B.TextBox1.Text = DgA B.TextBox2.Text = DgB B.TextBox3.Text = DgC B.TextBox4.Text = DgD B.Show() End Sub
Private Sub fmB(sender As System.Object, e As System.EventArgs) Handles MyBase.Load With ComboBox1 .Items.Add("男性") .Items.Add("女性") End With ComboBox1.SelectedIndex = Me.TextBox4.Text End Sub