• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

EveryDB2のデータベースを読み込んでWinFormでGUI表示するサンプル


Commit MetaInfo

Revision1dfad69bb82fe8edde5e3a20e7b262626dbff82c (tree)
Zeit2021-06-01 08:54:29
Autoryoshy <yoshy@user...>
Commiteryoshy

Log Message

temp_20210601_0854

Ändern Zusammenfassung

Diff

--- a/App/Adaptor/Gateway/ViewModel/Dto/SearchRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/SearchRaceRowDto.cs
@@ -20,14 +20,24 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
2020 BeanHelper.Copy(this, race);
2121 }
2222
23- public string JyoName { get => CodeHelper.GetInstance().GetName(CodeHelper.JYO_CODE, Jyocd, 3, "不明"); }
23+ public string JyoName => CodeHelper.GetInstance().GetName(CodeHelper.JYO_CODE, Jyocd, 3, "不明");
2424
25- public string YearMonthDay { get => Year + "/" + Monthday.Substring(0, 2) + "/" + Monthday.Substring(2, 2); }
25+ public string YearMonthDay => Year + "/" + Monthday.Substring(0, 2) + "/" + Monthday.Substring(2, 2);
2626
2727 public string RaceName => CodeHelper.GetInstance().GetRaceName(this, "不明");
2828
2929 public string GradeName => CodeHelper.GetInstance().GetName(CodeHelper.GRADE_CODE, Gradecd, "-");
3030
3131 public string CourseName => CodeHelper.GetInstance().GetTrackKubun(Trackcd, "不明") + Kyori;
32+
33+ public string SyussoTosuFormatted => !string.IsNullOrEmpty(Syussotosu)
34+ ? int.Parse(Syussotosu).ToString()
35+ : string.Empty;
36+
37+ public string HassoTimeFormatted => !string.IsNullOrEmpty(Hassotime) && Hassotime.Length == 4
38+ ? Hassotime != "0000"
39+ ? Hassotime.Substring(0,2) + ":" + Hassotime.Substring(2, 2)
40+ : "-"
41+ : Hassotime;
3242 }
3343 }
--- a/App/Adaptor/Gateway/ViewModel/Dto/TokuRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/TokuRaceRowDto.cs
@@ -20,14 +20,16 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
2020 BeanHelper.Copy(this, race);
2121 }
2222
23- public string YearMonthDay { get => Year + "/" + Monthday.Substring(0, 2) + "/" + Monthday.Substring(2, 2); }
23+ public string YearMonthDay => Year + "/" + Monthday.Substring(0, 2) + "/" + Monthday.Substring(2, 2);
2424
25- public string JyoName { get => CodeHelper.GetInstance().GetName(CodeHelper.JYO_CODE, Jyocd, 3, "不明"); }
25+ public string JyoName => CodeHelper.GetInstance().GetName(CodeHelper.JYO_CODE, Jyocd, 3, "不明");
2626
2727 public string RaceName => CodeHelper.GetInstance().GetRaceName(this, "不明");
2828
2929 public string GradeName => CodeHelper.GetInstance().GetName(CodeHelper.GRADE_CODE, Gradecd, "-");
3030
3131 public string CourseName => CodeHelper.GetInstance().GetTrackKubun(Trackcd, "不明") + Kyori;
32+
33+ public string TorokuTosuFormatted => !string.IsNullOrEmpty(Torokutosu) ? int.Parse(Torokutosu).ToString() : string.Empty;
3234 }
3335 }
--- a/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
@@ -19,15 +19,21 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
1919 BeanHelper.Copy(this, umaRace);
2020 }
2121
22- public string YearMonthDay { get => Year + "/" + Monthday.Substring(0, 2) + "/" + Monthday.Substring(2, 2); }
22+ public string YearMonthDay => Year + "/" + Monthday.Substring(0, 2) + "/" + Monthday.Substring(2, 2);
2323
24- public string JyoName { get => CodeHelper.GetInstance().GetName(CodeHelper.JYO_CODE, Jyocd, 3, "不明"); }
24+ public string JyoName => CodeHelper.GetInstance().GetName(CodeHelper.JYO_CODE, Jyocd, 3, "不明");
2525
26- public string RaceName => Race != null ? CodeHelper.GetInstance().GetRaceName(Race, "不明") : string.Empty;
26+ public string RaceName => Race != null
27+ ? CodeHelper.GetInstance().GetRaceName(Race, "不明")
28+ : string.Empty;
2729
28- public string GradeName => CodeHelper.GetInstance().GetName(CodeHelper.GRADE_CODE, Race.Gradecd, "-");
30+ public string GradeName => Race != null
31+ ? CodeHelper.GetInstance().GetName(CodeHelper.GRADE_CODE, Race.Gradecd, "-")
32+ : string.Empty;
2933
30- public string CourseName => Race != null ? CodeHelper.GetInstance().GetTrackKubun(Race.Trackcd, "不明") + Race.Kyori : string.Empty;
34+ public string CourseName => Race != null
35+ ? CodeHelper.GetInstance().GetTrackKubun(Race.Trackcd, "不明") + Race.Kyori
36+ : string.Empty;
3137
3238 public string Kimete => CodeHelper.GetInstance().GetName(CodeHelper.KYAKUSITU_KUBUN, Kyakusitukubun, "不明");
3339
@@ -48,10 +54,9 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
4854 }
4955 }
5056
51- public string TimeFormatted
52- {
53- get => Time.Length >= 4 ? $"{Time.Substring(0,1)}:{Time.Substring(1, 2)}.{Time.Substring(3, 1)}" : Time;
54- }
57+ public string TimeFormatted => Time.Length == 4
58+ ? $"{Time.Substring(0,1)}:{Time.Substring(1, 2)}.{Time.Substring(3, 1)}"
59+ : Time;
5560
5661 public string FutanFormatted
5762 {
--- a/App/Presentation/View/MainWindow.Designer.cs
+++ b/App/Presentation/View/MainWindow.Designer.cs
@@ -34,6 +34,7 @@ namespace UmaTest.App.Presentation.View
3434 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
3535 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
3636 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
37+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
3738 this.menuStrip1 = new System.Windows.Forms.MenuStrip();
3839 this.toolStripMenuFile = new System.Windows.Forms.ToolStripMenuItem();
3940 this.toolStripMenuOpenHorseList = new System.Windows.Forms.ToolStripMenuItem();
@@ -165,6 +166,7 @@ namespace UmaTest.App.Presentation.View
165166 //
166167 this.dataGridView1.AllowUserToAddRows = false;
167168 this.dataGridView1.AllowUserToDeleteRows = false;
169+ this.dataGridView1.AllowUserToResizeColumns = false;
168170 this.dataGridView1.AllowUserToResizeRows = false;
169171 this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.ColumnHeader;
170172 dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
@@ -181,9 +183,16 @@ namespace UmaTest.App.Presentation.View
181183 this.dataGridView1.MultiSelect = false;
182184 this.dataGridView1.Name = "dataGridView1";
183185 this.dataGridView1.ReadOnly = true;
186+ dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
187+ dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
188+ dataGridViewCellStyle2.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
189+ dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
190+ dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
191+ dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
192+ this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle2;
184193 this.dataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
185- dataGridViewCellStyle2.Font = new System.Drawing.Font("Meiryo UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
186- this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle2;
194+ dataGridViewCellStyle3.Font = new System.Drawing.Font("Meiryo UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
195+ this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle3;
187196 this.dataGridView1.RowTemplate.Height = 21;
188197 this.dataGridView1.RowTemplate.ReadOnly = true;
189198 this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
@@ -194,33 +203,34 @@ namespace UmaTest.App.Presentation.View
194203 //
195204 this.dataGridView2.AllowUserToAddRows = false;
196205 this.dataGridView2.AllowUserToDeleteRows = false;
206+ this.dataGridView2.AllowUserToResizeColumns = false;
197207 this.dataGridView2.AllowUserToResizeRows = false;
198208 this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.ColumnHeader;
199- dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
200- dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
201- dataGridViewCellStyle3.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
202- dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
203- dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
204- dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
205- dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
206- this.dataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3;
207- this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
208- this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill;
209- this.dataGridView2.Location = new System.Drawing.Point(0, 0);
210- this.dataGridView2.MultiSelect = false;
211- this.dataGridView2.Name = "dataGridView2";
212- this.dataGridView2.ReadOnly = true;
213209 dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
214210 dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
215211 dataGridViewCellStyle4.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
216212 dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
217213 dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
218214 dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
219- dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
220- this.dataGridView2.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
215+ dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
216+ this.dataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
217+ this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
218+ this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill;
219+ this.dataGridView2.Location = new System.Drawing.Point(0, 0);
220+ this.dataGridView2.MultiSelect = false;
221+ this.dataGridView2.Name = "dataGridView2";
222+ this.dataGridView2.ReadOnly = true;
223+ dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
224+ dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
225+ dataGridViewCellStyle5.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
226+ dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
227+ dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
228+ dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
229+ dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
230+ this.dataGridView2.RowHeadersDefaultCellStyle = dataGridViewCellStyle5;
221231 this.dataGridView2.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
222- dataGridViewCellStyle5.Font = new System.Drawing.Font("Meiryo UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
223- this.dataGridView2.RowsDefaultCellStyle = dataGridViewCellStyle5;
232+ dataGridViewCellStyle6.Font = new System.Drawing.Font("Meiryo UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
233+ this.dataGridView2.RowsDefaultCellStyle = dataGridViewCellStyle6;
224234 this.dataGridView2.RowTemplate.Height = 21;
225235 this.dataGridView2.RowTemplate.ReadOnly = true;
226236 this.dataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
--- a/App/Presentation/View/MainWindow.cs
+++ b/App/Presentation/View/MainWindow.cs
@@ -457,7 +457,7 @@ namespace UmaTest.App.Presentation.View
457457 case "UmaSummaryList":
458458 {
459459 bindingSource1.DataSource = vm.UmaSummaryList;
460- AdjustDataGridView(dataGridView1, bindingSource1, vm.UmaSummaryList.Count, splitContainer2.Panel1);
460+ DataGridViewHelper.AdjustDataGridView(dataGridView1, bindingSource1, vm.UmaSummaryList.Count, splitContainer2.Panel1);
461461
462462 if (dataGridView1.Rows.Count > 0)
463463 {
@@ -477,44 +477,10 @@ namespace UmaTest.App.Presentation.View
477477 case "RaceList":
478478 {
479479 bindingSource2.DataSource = vm.RaceList;
480- AdjustDataGridView(dataGridView2, bindingSource2, vm.RaceList.Count, splitContainer2.Panel2);
480+ DataGridViewHelper.AdjustDataGridView(dataGridView2, bindingSource2, vm.RaceList.Count, splitContainer2.Panel2);
481481 }
482482 break;
483483 }
484484 }
485-
486- private void AdjustDataGridView(DataGridView dataGridView, BindingSource bindingSource, int dataSourceCount, Panel panel)
487- {
488- Size size = dataGridView.Size;
489-
490- dataGridView.SuspendLayout();
491-
492- dataGridView.ScrollBars = ScrollBars.None;
493- panel.BackColor = SystemColors.ControlText;
494-
495- size.Height = size.Height - 1;
496- dataGridView.Size = size;
497-
498- dataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;
499- dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
500- dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
501- dataGridView.DataSource = bindingSource;
502-
503- dataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
504- dataGridView.AutoSizeColumnsMode = dataSourceCount > 0
505- ? DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader
506- : DataGridViewAutoSizeColumnsMode.AllCells;
507- dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
508-
509- size.Height = size.Height + 1;
510- dataGridView.Size = size;
511-
512- dataGridView.ScrollBars = ScrollBars.Both;
513- panel.BackColor = SystemColors.AppWorkspace;
514-
515- dataGridView.ClearSelection();
516-
517- dataGridView.ResumeLayout();
518- }
519485 }
520486 }
--- a/App/Presentation/View/SearchRaceView.Designer.cs
+++ b/App/Presentation/View/SearchRaceView.Designer.cs
@@ -31,6 +31,7 @@ namespace UmaTest.App.Presentation.View
3131 {
3232 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
3333 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
34+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
3435 this.splitContainer1 = new System.Windows.Forms.SplitContainer();
3536 this.dataGridView1 = new System.Windows.Forms.DataGridView();
3637 this.btnSearch = new System.Windows.Forms.Button();
@@ -61,7 +62,7 @@ namespace UmaTest.App.Presentation.View
6162 this.splitContainer1.Panel2.Controls.Add(this.btnSearch);
6263 this.splitContainer1.Panel2.Controls.Add(this.btnCancel);
6364 this.splitContainer1.Panel2.Controls.Add(this.btnSelect);
64- this.splitContainer1.Size = new System.Drawing.Size(695, 584);
65+ this.splitContainer1.Size = new System.Drawing.Size(790, 584);
6566 this.splitContainer1.SplitterDistance = 521;
6667 this.splitContainer1.TabIndex = 0;
6768 //
@@ -69,6 +70,8 @@ namespace UmaTest.App.Presentation.View
6970 //
7071 this.dataGridView1.AllowUserToAddRows = false;
7172 this.dataGridView1.AllowUserToDeleteRows = false;
73+ this.dataGridView1.AllowUserToResizeColumns = false;
74+ this.dataGridView1.AllowUserToResizeRows = false;
7275 this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.ColumnHeader;
7376 dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
7477 dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
@@ -92,17 +95,25 @@ namespace UmaTest.App.Presentation.View
9295 this.dataGridView1.MultiSelect = false;
9396 this.dataGridView1.Name = "dataGridView1";
9497 this.dataGridView1.ReadOnly = true;
98+ dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
99+ dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
100+ dataGridViewCellStyle3.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
101+ dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
102+ dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
103+ dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
104+ this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
105+ this.dataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
95106 this.dataGridView1.RowTemplate.Height = 21;
96107 this.dataGridView1.RowTemplate.ReadOnly = true;
97108 this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
98- this.dataGridView1.Size = new System.Drawing.Size(695, 521);
109+ this.dataGridView1.Size = new System.Drawing.Size(790, 521);
99110 this.dataGridView1.TabIndex = 0;
100111 //
101112 // btnSearch
102113 //
103114 this.btnSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
104115 this.btnSearch.DialogResult = System.Windows.Forms.DialogResult.Cancel;
105- this.btnSearch.Location = new System.Drawing.Point(617, 3);
116+ this.btnSearch.Location = new System.Drawing.Point(712, 3);
106117 this.btnSearch.Name = "btnSearch";
107118 this.btnSearch.Size = new System.Drawing.Size(75, 24);
108119 this.btnSearch.TabIndex = 2;
@@ -113,7 +124,7 @@ namespace UmaTest.App.Presentation.View
113124 //
114125 this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
115126 this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
116- this.btnCancel.Location = new System.Drawing.Point(537, 32);
127+ this.btnCancel.Location = new System.Drawing.Point(632, 32);
117128 this.btnCancel.Name = "btnCancel";
118129 this.btnCancel.Size = new System.Drawing.Size(74, 25);
119130 this.btnCancel.TabIndex = 1;
@@ -124,7 +135,7 @@ namespace UmaTest.App.Presentation.View
124135 //
125136 this.btnSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
126137 this.btnSelect.DialogResult = System.Windows.Forms.DialogResult.Cancel;
127- this.btnSelect.Location = new System.Drawing.Point(617, 33);
138+ this.btnSelect.Location = new System.Drawing.Point(712, 33);
128139 this.btnSelect.Name = "btnSelect";
129140 this.btnSelect.Size = new System.Drawing.Size(75, 24);
130141 this.btnSelect.TabIndex = 0;
@@ -137,7 +148,7 @@ namespace UmaTest.App.Presentation.View
137148 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
138149 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
139150 this.CancelButton = this.btnCancel;
140- this.ClientSize = new System.Drawing.Size(695, 584);
151+ this.ClientSize = new System.Drawing.Size(790, 584);
141152 this.ControlBox = false;
142153 this.Controls.Add(this.splitContainer1);
143154 this.MaximizeBox = false;
--- a/App/Presentation/View/SearchRaceView.cs
+++ b/App/Presentation/View/SearchRaceView.cs
@@ -112,14 +112,25 @@ namespace UmaTest.App.Presentation.View
112112 },
113113 new DataGridViewTextBoxColumn
114114 {
115- DataPropertyName = "Hassotime",
115+ DataPropertyName = "SyussoTosuFormatted",
116+ Name = "頭数",
117+ },
118+ new DataGridViewTextBoxColumn
119+ {
120+ DataPropertyName = "HassoTimeFormatted",
116121 Name = "発走",
117122 },
118123 };
119124
120125 grid1Cols.Do(col => col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter);
121-
122126 dataGridView1.Columns.AddRange(grid1Cols);
127+
128+ dataGridView1.Columns["コース"].HeaderCell.Style.WrapMode = DataGridViewTriState.False;
129+
130+ dataGridView1.Columns["場所"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
131+ dataGridView1.Columns["R"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
132+ dataGridView1.Columns["頭数"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
133+ dataGridView1.Columns["発走"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
123134 }
124135
125136 private void OnViewModelChanged(object sender, EventArgs e)
@@ -129,13 +140,9 @@ namespace UmaTest.App.Presentation.View
129140 switch (args.PropertyName)
130141 {
131142 case "SearchResultRaceList":
132- dataGridView1.SuspendLayout();
133- //dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;
134- dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
135143 bindingSource1.DataSource = vm.SearchResultRaceList;
136- //dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
137- dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
138- dataGridView1.ResumeLayout();
144+ DataGridViewHelper.AdjustDataGridView(
145+ dataGridView1, bindingSource1, vm.SearchResultRaceList.Count, splitContainer1.Panel1);
139146 break;
140147 default:
141148 break;
--- a/App/Presentation/View/TokuRaceListView.Designer.cs
+++ b/App/Presentation/View/TokuRaceListView.Designer.cs
@@ -31,6 +31,7 @@ namespace UmaTest.App.Presentation.View
3131 {
3232 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
3333 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
34+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
3435 this.splitContainer1 = new System.Windows.Forms.SplitContainer();
3536 this.dataGridView1 = new System.Windows.Forms.DataGridView();
3637 this.btnCancel = new System.Windows.Forms.Button();
@@ -59,14 +60,16 @@ namespace UmaTest.App.Presentation.View
5960 //
6061 this.splitContainer1.Panel2.Controls.Add(this.btnCancel);
6162 this.splitContainer1.Panel2.Controls.Add(this.btnSelect);
62- this.splitContainer1.Size = new System.Drawing.Size(416, 455);
63- this.splitContainer1.SplitterDistance = 425;
63+ this.splitContainer1.Size = new System.Drawing.Size(629, 559);
64+ this.splitContainer1.SplitterDistance = 529;
6465 this.splitContainer1.TabIndex = 0;
6566 //
6667 // dataGridView1
6768 //
6869 this.dataGridView1.AllowUserToAddRows = false;
6970 this.dataGridView1.AllowUserToDeleteRows = false;
71+ this.dataGridView1.AllowUserToResizeColumns = false;
72+ this.dataGridView1.AllowUserToResizeRows = false;
7073 this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.ColumnHeader;
7174 dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
7275 dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
@@ -89,16 +92,26 @@ namespace UmaTest.App.Presentation.View
8992 this.dataGridView1.Location = new System.Drawing.Point(0, 0);
9093 this.dataGridView1.MultiSelect = false;
9194 this.dataGridView1.Name = "dataGridView1";
95+ this.dataGridView1.ReadOnly = true;
96+ dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
97+ dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
98+ dataGridViewCellStyle3.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
99+ dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
100+ dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
101+ dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
102+ this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
103+ this.dataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
92104 this.dataGridView1.RowTemplate.Height = 21;
105+ this.dataGridView1.RowTemplate.ReadOnly = true;
93106 this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
94- this.dataGridView1.Size = new System.Drawing.Size(416, 425);
107+ this.dataGridView1.Size = new System.Drawing.Size(629, 529);
95108 this.dataGridView1.TabIndex = 0;
96109 //
97110 // btnCancel
98111 //
99112 this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
100113 this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
101- this.btnCancel.Location = new System.Drawing.Point(258, -1);
114+ this.btnCancel.Location = new System.Drawing.Point(471, -1);
102115 this.btnCancel.Name = "btnCancel";
103116 this.btnCancel.Size = new System.Drawing.Size(74, 25);
104117 this.btnCancel.TabIndex = 1;
@@ -108,7 +121,7 @@ namespace UmaTest.App.Presentation.View
108121 // btnSelect
109122 //
110123 this.btnSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
111- this.btnSelect.Location = new System.Drawing.Point(338, 0);
124+ this.btnSelect.Location = new System.Drawing.Point(551, 0);
112125 this.btnSelect.Name = "btnSelect";
113126 this.btnSelect.Size = new System.Drawing.Size(75, 23);
114127 this.btnSelect.TabIndex = 0;
@@ -121,7 +134,7 @@ namespace UmaTest.App.Presentation.View
121134 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
122135 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
123136 this.CancelButton = this.btnCancel;
124- this.ClientSize = new System.Drawing.Size(416, 455);
137+ this.ClientSize = new System.Drawing.Size(629, 559);
125138 this.ControlBox = false;
126139 this.Controls.Add(this.splitContainer1);
127140 this.MaximizeBox = false;
--- a/App/Presentation/View/TokuRaceListView.cs
+++ b/App/Presentation/View/TokuRaceListView.cs
@@ -110,11 +110,21 @@ namespace UmaTest.App.Presentation.View
110110 DataPropertyName = "CourseName",
111111 Name = "コース",
112112 },
113+ new DataGridViewTextBoxColumn
114+ {
115+ DataPropertyName = "TorokuTosuFormatted",
116+ Name = "頭数",
117+ },
113118 };
114119
115120 grid1Cols.Do(col => col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter);
116-
117121 dataGridView1.Columns.AddRange(grid1Cols);
122+
123+ dataGridView1.Columns["コース"].HeaderCell.Style.WrapMode = DataGridViewTriState.False;
124+
125+ dataGridView1.Columns["場所"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
126+ dataGridView1.Columns["R"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
127+ dataGridView1.Columns["頭数"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
118128 }
119129
120130 private void OnViewModelChanged(object sender, EventArgs e)
@@ -124,13 +134,9 @@ namespace UmaTest.App.Presentation.View
124134 switch (args.PropertyName)
125135 {
126136 case "TokuRaceList":
127- dataGridView1.SuspendLayout();
128- //dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;
129- dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
130137 bindingSource1.DataSource = vm.TokuRaceList;
131- //dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
132- dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
133- dataGridView1.ResumeLayout();
138+ DataGridViewHelper.AdjustDataGridView(
139+ dataGridView1, bindingSource1, vm.TokuRaceList.Count, splitContainer1.Panel1);
134140 break;
135141 default:
136142 break;
--- /dev/null
+++ b/Infra/Presentation/View/DataGridViewHelper.cs
@@ -0,0 +1,48 @@
1+
2+using System;
3+using System.Collections.Generic;
4+using System.Drawing;
5+using System.Linq;
6+using System.Text;
7+using System.Threading.Tasks;
8+using System.Windows.Forms;
9+
10+namespace UmaTest.Infra.Presentation.View
11+{
12+ internal class DataGridViewHelper
13+ {
14+ public static void AdjustDataGridView(DataGridView dataGridView, BindingSource bindingSource, int dataSourceCount, Panel panel)
15+ {
16+ Size size = dataGridView.Size;
17+
18+ dataGridView.SuspendLayout();
19+
20+ dataGridView.ScrollBars = ScrollBars.None;
21+ panel.BackColor = SystemColors.ControlText;
22+
23+ size.Height = size.Height - 1;
24+ dataGridView.Size = size;
25+
26+ dataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;
27+ dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
28+ dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
29+ dataGridView.DataSource = bindingSource;
30+
31+ dataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
32+ dataGridView.AutoSizeColumnsMode = dataSourceCount > 0
33+ ? DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader
34+ : DataGridViewAutoSizeColumnsMode.AllCells;
35+ dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
36+
37+ size.Height = size.Height + 1;
38+ dataGridView.Size = size;
39+
40+ dataGridView.ScrollBars = ScrollBars.Both;
41+ panel.BackColor = SystemColors.AppWorkspace;
42+
43+ dataGridView.ClearSelection();
44+
45+ dataGridView.ResumeLayout();
46+ }
47+ }
48+}
--- a/UmaTest.csproj
+++ b/UmaTest.csproj
@@ -273,6 +273,7 @@
273273 <Compile Include="Infra\Domain\UseCase\UseCaseResponse.cs" />
274274 <Compile Include="Infra\Adaptor\Controller\Handler\UseCaseRouter.cs" />
275275 <Compile Include="Infra\Presentation\View\DataContextHelper.cs" />
276+ <Compile Include="Infra\Presentation\View\DataGridViewHelper.cs" />
276277 <Compile Include="Infra\Presentation\View\IChildWindow.cs" />
277278 <Compile Include="Infra\Presentation\View\IChildDialog.cs" />
278279 <Compile Include="Infra\Presentation\View\IOwnerForm.cs" />