質問編集履歴
2
ソースコードをバッククオートで囲んで見やすくした。
title
CHANGED
File without changes
|
body
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
制作環境:Visual Studio 2019(Community)
|
12
12
|
|
13
13
|
ソースコード(Form1.Designer.cs)
|
14
|
+
```
|
14
15
|
namespace StatusBar
|
15
16
|
{
|
16
17
|
partial class Form1
|
@@ -95,4 +96,5 @@
|
|
95
96
|
private System.Windows.Forms.ToolStripStatusLabel labelA;
|
96
97
|
private System.Windows.Forms.ToolStripStatusLabel labelB;
|
97
98
|
}
|
98
|
-
}
|
99
|
+
}
|
100
|
+
```
|
1
サンプルソースコード(デザイン)を追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
過去に作っていたメールソフトの焼き直しをいちからしています。
|
2
|
+
|
1
|
-
以前
|
3
|
+
以前Visual Studio 2005などでは出来たことなのですが、ステータスラベルを2つ作り
|
2
4
|
名前をlabelA、labelBとして作成し、labelAにはSpringプロパティをtrueにして
|
3
5
|
labelBはそのままでプログラムを実行したとき、labelBのテキストが表示されない
|
4
6
|
問題が発生しました。
|
@@ -6,4 +8,91 @@
|
|
6
8
|
やりたいことはlabelBの文字をステータスバー上に表示したいのですがどうすれば
|
7
9
|
良いでしょうか?
|
8
10
|
|
9
|
-
制作環境:Visual Studio 2019(Community)
|
11
|
+
制作環境:Visual Studio 2019(Community)
|
12
|
+
|
13
|
+
ソースコード(Form1.Designer.cs)
|
14
|
+
namespace StatusBar
|
15
|
+
{
|
16
|
+
partial class Form1
|
17
|
+
{
|
18
|
+
/// <summary>
|
19
|
+
/// 必要なデザイナー変数です。
|
20
|
+
/// </summary>
|
21
|
+
private System.ComponentModel.IContainer components = null;
|
22
|
+
|
23
|
+
/// <summary>
|
24
|
+
/// 使用中のリソースをすべてクリーンアップします。
|
25
|
+
/// </summary>
|
26
|
+
/// <param name="disposing">マネージド リソースを破棄する場合は true を指定し、その他の場合は false を指定します。</param>
|
27
|
+
protected override void Dispose(bool disposing)
|
28
|
+
{
|
29
|
+
if (disposing && (components != null))
|
30
|
+
{
|
31
|
+
components.Dispose();
|
32
|
+
}
|
33
|
+
base.Dispose(disposing);
|
34
|
+
}
|
35
|
+
|
36
|
+
#region Windows フォーム デザイナーで生成されたコード
|
37
|
+
|
38
|
+
/// <summary>
|
39
|
+
/// デザイナー サポートに必要なメソッドです。このメソッドの内容を
|
40
|
+
/// コード エディターで変更しないでください。
|
41
|
+
/// </summary>
|
42
|
+
private void InitializeComponent()
|
43
|
+
{
|
44
|
+
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
45
|
+
this.labelA = new System.Windows.Forms.ToolStripStatusLabel();
|
46
|
+
this.labelB = new System.Windows.Forms.ToolStripStatusLabel();
|
47
|
+
this.statusStrip1.SuspendLayout();
|
48
|
+
this.SuspendLayout();
|
49
|
+
//
|
50
|
+
// statusStrip1
|
51
|
+
//
|
52
|
+
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
53
|
+
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
54
|
+
this.labelA,
|
55
|
+
this.labelB});
|
56
|
+
this.statusStrip1.Location = new System.Drawing.Point(0, 420);
|
57
|
+
this.statusStrip1.Name = "statusStrip1";
|
58
|
+
this.statusStrip1.Size = new System.Drawing.Size(800, 30);
|
59
|
+
this.statusStrip1.TabIndex = 0;
|
60
|
+
this.statusStrip1.Text = "statusStrip1";
|
61
|
+
//
|
62
|
+
// labelA
|
63
|
+
//
|
64
|
+
this.labelA.Name = "labelA";
|
65
|
+
this.labelA.Size = new System.Drawing.Size(729, 24);
|
66
|
+
this.labelA.Spring = true;
|
67
|
+
this.labelA.Text = "ラベルA";
|
68
|
+
this.labelA.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
69
|
+
//
|
70
|
+
// labelB
|
71
|
+
//
|
72
|
+
this.labelB.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Left;
|
73
|
+
this.labelB.Name = "labelB";
|
74
|
+
this.labelB.Size = new System.Drawing.Size(56, 24);
|
75
|
+
this.labelB.Text = "ラベルB";
|
76
|
+
//
|
77
|
+
// Form1
|
78
|
+
//
|
79
|
+
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
80
|
+
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
81
|
+
this.ClientSize = new System.Drawing.Size(800, 450);
|
82
|
+
this.Controls.Add(this.statusStrip1);
|
83
|
+
this.Name = "Form1";
|
84
|
+
this.Text = "Form1";
|
85
|
+
this.statusStrip1.ResumeLayout(false);
|
86
|
+
this.statusStrip1.PerformLayout();
|
87
|
+
this.ResumeLayout(false);
|
88
|
+
this.PerformLayout();
|
89
|
+
|
90
|
+
}
|
91
|
+
|
92
|
+
#endregion
|
93
|
+
|
94
|
+
private System.Windows.Forms.StatusStrip statusStrip1;
|
95
|
+
private System.Windows.Forms.ToolStripStatusLabel labelA;
|
96
|
+
private System.Windows.Forms.ToolStripStatusLabel labelB;
|
97
|
+
}
|
98
|
+
}
|