Private Class Record Public 名前 As TextBox Public 守備 As TextBox Public 打率 As TextBox Public HR As NumericUpDown Public 打点 As NumericUpDown Public 盗塁 As NumericUpDown Public Sub New(名前 As TextBox, 守備 As TextBox, 打率 As TextBox, HR As NumericUpDown, 打点 As NumericUpDown, 盗塁 As NumericUpDown) Me.名前 = 名前 Me.守備 = 守備 Me.打率 = 打率 Me.HR = HR Me.打点 = 打点 Me.盗塁 = 盗塁 End Sub End Class
DicTextBox = New Dictionary(Of String, Record) DicTextBox.Add("1", New Record(TextBox1, TextBox2, TextBox3, NumericUpDown1, NumericUpDown2, NumericUpDown3))
wt.WriteLine("{0}{1} 守備{2} 打率{3} HR{4} 打点{5} 盗塁{6}", keyvalue.Key, _ keyvalue.Value.名前.Text, keyvalue.Value.守備.Text, keyvalue.Value.打率.Text, _ keyvalue.Value.HR.Value, keyvalue.Value.打点.Value, keyvalue.Value.盗塁.Value)