質問編集履歴

2

asfewfafaefsfweasdfeasd

2019/12/30 07:02

投稿

JumpActionGames
JumpActionGames

スコア29

test CHANGED
File without changes
test CHANGED
@@ -56,7 +56,7 @@
56
56
 
57
57
  ## 試したこと
58
58
 
59
- ```
59
+ ```C#
60
60
 
61
61
  Dictionary b = new Dictionary(){{"abc","あ"},{"cba","い"}}
62
62
 
@@ -72,7 +72,7 @@
72
72
 
73
73
  を、
74
74
 
75
- ```
75
+ ```C#
76
76
 
77
77
  Dictionary b = new Dictionary(){{"abc","あ"},{"cba","い"}}
78
78
 
@@ -100,9 +100,39 @@
100
100
 
101
101
  ```
102
102
 
103
+
104
+
103
105
  という感じにしましたが、
104
106
 
105
107
  もし、設定する対象が、コントロール以外だったら、できません!
108
+
109
+
110
+
111
+ label.Text = 〇〇; の前に、
112
+
113
+ ```C#
114
+
115
+ try
116
+
117
+ {
118
+
119
+ label.Text = 〇〇;
120
+
121
+ }
122
+
123
+ catch
124
+
125
+ {
126
+
127
+ return;
128
+
129
+ }
130
+
131
+ ```
132
+
133
+ という感じにしたら、そりゃ対処できますが、
134
+
135
+ コードが増えてしまいます!!
106
136
 
107
137
  # エラーメッセージ
108
138
 

1

aaa

2019/12/30 07:02

投稿

JumpActionGames
JumpActionGames

スコア29

test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ```
6
6
 
7
- Dictionary b = new Dictionary(){{"abc","あ"},{"cba","い"}}
7
+ Dictionary<string,string> b = new Dictionary<string,string>{{"abc","あ"},{"cba","い"}}
8
8
 
9
9
  string a(string c)
10
10
 
@@ -104,7 +104,37 @@
104
104
 
105
105
  もし、設定する対象が、コントロール以外だったら、できません!
106
106
 
107
+ # エラーメッセージ
107
108
 
109
+ 存在しないKeyを指定したとき
110
+
111
+ |ハンドルされてない例外 |????|✖|
112
+
113
+ |:--|:--:|--:|
114
+
115
+ |System.Collections.Generic.KeyNotFoundException: '指定されたキーはディレクトリ内に存在しませんでした。'|||
116
+
117
+ |この例外は、最初にこの呼び出し履歴でスローされました:
118
+
119
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
120
+
121
+ System.Collections.Generic.Dictionary<TKey, TValue>.this[TKey].get(TKey)
122
+
123
+ [名前空間_Test.値の設定メソッド()] の Setting.cs(navigate-to-context:1)
124
+
125
+ [名前空間_Test.Form1.Load(object, System.EventArgs)] の Setting.cs(navigate-to-context:2)
126
+
127
+ System.Windows.Forms.ListControl.OnSelectedValueChanged(System.EventArgs)
128
+
129
+ System.Windows.Forms.Load(object sender, EventArgs e)
130
+
131
+ System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message)
132
+
133
+ System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message)
134
+
135
+ ...
136
+
137
+ [呼び出し履歴の切り捨て]|||
108
138
 
109
139
  #使用ツールなど
110
140