掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
こんなことできないでしょうか? (ID:90433)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
ありがとうございます。 書きなおして見ました。 Privat pTextBox As System.Windows.Forms.TextBox() Private pChStr(30) As String 'pChStr(30)はXMLファイルに書き出した設定値を 'この配列に読み込んでいます。 'テキストボックス描画 pTextBox = New TextBox(30) {} Dim fontF As New Font("MS UI Gothic", 9) Dim x, y As Integer For i As Integer = 0 To 30 pegTextBox(i) = New TextBox pegTextBox(i).Name = "pTextBox" & (i + 1).ToString() pegTextBox(i).Font = fontF pegTextBox(i).Text = pChStr(i) pegTextBox(i).Width = 150 pegTextBox(i).Height = 23 x = 50 y = 20 + (i * 28) pTextBox(i).Location = New Point(x, y) Me.Controls.Add(pTextBox(i)) AddHandler pTextBox(i).TextChanged, AddressOf PTextBoxes_TextChanged Next Private Sub PTextBoxes_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim hTextBox As TextBox = DirectCast(sender, TextBox) If hTextBox.Name = "pTextBox1" Then pdChStr(0) = CType(sender, TextBox).Text End If 'ここはすべて書きました。 End Sub これでもコンパイルできました。 イベントを拾うのにIF文を31個書きました。
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.