質問編集履歴

6

宣言されていない変数の修正

2021/01/06 00:37

投稿

TEC_S
TEC_S

スコア79

test CHANGED
File without changes
test CHANGED
@@ -182,7 +182,7 @@
182
182
 
183
183
 
184
184
 
185
- For i = 0 To DmMaxNum
185
+ For i = 0 To DMaxNum
186
186
 
187
187
  If DLabel(i).Name = "lbl" & setAddres Then 'ここでSystem.NullReferenceException
188
188
 

5

宣言されていない変数のソース追加

2021/01/06 00:37

投稿

TEC_S
TEC_S

スコア79

test CHANGED
File without changes
test CHANGED
@@ -44,6 +44,10 @@
44
44
 
45
45
  Private DRBtn(DMaxNum) As System.Windows.Forms.Button
46
46
 
47
+ Private Const TextAStart As Integer = 232 'テキストBoxのスタート位置.  
48
+
49
+   Private Const BtnAllStart As Integer = 482
50
+
47
51
 
48
52
 
49
53
  Private Sub plcForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
@@ -70,6 +74,12 @@
70
74
 
71
75
  Dim i As Integer
72
76
 
77
+ Dim Num As Integer = 0
78
+
79
+ Dim i As IpArea_X = BtnAllStart
80
+
81
+
82
+
73
83
  For i = 1 To DMaxNum
74
84
 
75
85
  DLabel(i) = New System.Windows.Forms.Label

4

コードの修正

2021/01/06 00:32

投稿

TEC_S
TEC_S

スコア79

test CHANGED
File without changes
test CHANGED
@@ -118,7 +118,7 @@
118
118
 
119
119
  DRBtn(i).Location = New Point(sx + BtnRStart + Num * IpArea_X, sy + YIdx * Yohaku)
120
120
 
121
- DmRBtn(i).Size = New System.Drawing.Size(50, 20)
121
+ DRBtn(i).Size = New System.Drawing.Size(50, 20)
122
122
 
123
123
 
124
124
 

3

コード修正

2021/01/05 23:42

投稿

TEC_S
TEC_S

スコア79

test CHANGED
File without changes
test CHANGED
@@ -34,13 +34,15 @@
34
34
 
35
35
  ```VBNET
36
36
 
37
+ private DMaxNum As Integer = 200
38
+
37
39
  private DLabel(DMaxNum) As System.Windows.Forms.Label
38
40
 
39
41
  private DText(DMaxNum) As System.Windows.Forms.TextBox
40
42
 
41
- Private DWBtn(DmCountMax) As System.Windows.Forms.Button
43
+ Private DWBtn(DMaxNum) As System.Windows.Forms.Button
42
-
44
+
43
- Private DRBtn(DmCountMax) As System.Windows.Forms.Button
45
+ Private DRBtn(DMaxNum) As System.Windows.Forms.Button
44
46
 
45
47
 
46
48
 
@@ -66,7 +68,7 @@
66
68
 
67
69
  Private Sub InitControl()
68
70
 
69
- Dim DMaxNum As Integer = 200
71
+ Dim i As Integer
70
72
 
71
73
  For i = 1 To DMaxNum
72
74
 

2

コードの修正

2021/01/05 23:41

投稿

TEC_S
TEC_S

スコア79

test CHANGED
File without changes
test CHANGED
@@ -34,6 +34,16 @@
34
34
 
35
35
  ```VBNET
36
36
 
37
+ private DLabel(DMaxNum) As System.Windows.Forms.Label
38
+
39
+ private DText(DMaxNum) As System.Windows.Forms.TextBox
40
+
41
+ Private DWBtn(DmCountMax) As System.Windows.Forms.Button
42
+
43
+ Private DRBtn(DmCountMax) As System.Windows.Forms.Button
44
+
45
+
46
+
37
47
  Private Sub plcForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
38
48
 
39
49
 

1

コードの修正

2021/01/05 23:38

投稿

TEC_S
TEC_S

スコア79

test CHANGED
File without changes
test CHANGED
@@ -72,9 +72,9 @@
72
72
 
73
73
  DLabel(i).Location = New Point(sx + Num * IpArea_X, sy + YIdx * Yohaku)
74
74
 
75
- DmLabel(i).Size = New System.Drawing.Size(230, 18)
75
+ DLabel(i).Size = New System.Drawing.Size(230, 18)
76
76
 
77
- DmLabel(i).Text = String.Format("DM{0} {1}", CInt(i), eName)
77
+ DLabel(i).Text = String.Format("DM{0} {1}", CInt(i), eName)
78
78
 
79
79
 
80
80