私は現在ファイルエクスプローラで作業しています。 これで、1つのラベルのForeColorを変更したいと思います。 しかし、私はそれのためのコードを追加すると、他のすべてが消えます。C#ラベルのForeColorを変更すると他のものが隠される
lblpath.ForeColor = ColorTranslator.FromHtml("00ff00");
私がアプリケーションを起動すると、Form1は空になります。
私は私のコードを投稿する必要がある場合、それはかなりなので、私は、知らないと私は部品が関連すると思われるか分からない...
編集:私はこのコードを使用 方法:
private void initiateGUI()
{
this.Text = "Explorer";
this.BackColor = ColorTranslator.FromHtml("#1a1a1a");
oneup = new Button();
oneup.Location = new Point(455, 12);
oneup.Parent = this;
oneup.Visible = true;
oneup.MouseClick += oneup_click;
oneup.Text = "UP";
oneup.Width = 40;
oneup.Height = 20;
cmdrefresh = new Button();
cmdrefresh.Location = new Point(500, 12);
cmdrefresh.Parent = this;
cmdrefresh.Visible = true;
cmdrefresh.MouseClick += refresh_click;
cmdrefresh.Text = "Refresh";
cmdrefresh.Width = 55;
cmdrefresh.Height = 20;
lblfolder.Location = new Point(475, 39);
lblfolder.Font = font;
//lblfolder.ForeColor = Color.Blue;
lblfolder.Parent = this;
lblfolder.Height = 13;
lblfolder.Text = "Folders";
lblfile.Location = new Point(12, 39);
lblfile.Font = font;
//lblfile.ForeColor = ColorTranslator.FromHtml("#00ff00");
lblfile.Parent = this;
lblfile.Height = 13;
lblfile.Text = "Files";
lblpath.Location = new Point(12, 15);
lblpath.Font = font;
lblpath.ForeColor = ColorTranslator.FromHtml("#00ff00");
lblpath.Parent = this;
lblpath.Height = 13;
lblpath.Width = 30;
lblpath.Text = "Path";
scrollfolder.AutoScroll = false;
scrollfolder.HorizontalScroll.Enabled = false;
scrollfolder.HorizontalScroll.Visible = false;
scrollfolder.HorizontalScroll.Maximum = 0;
scrollfolder.AutoScroll = true;
scrollfolder.Parent = this;
scrollfolder.Height = 390;
scrollfolder.Width = 220;
scrollfolder.Location = new Point(x2 - 10, y - 10);
scrollfiles.AutoScroll = false;
scrollfiles.HorizontalScroll.Enabled = false;
scrollfiles.HorizontalScroll.Visible = false;
scrollfiles.HorizontalScroll.Maximum = 0;
scrollfiles.AutoScroll = true;
scrollfiles.Parent = this;
scrollfiles.Height = 390;
scrollfiles.Width = 420;
scrollfiles.Location = new Point(x - 10, y - 10);
}
[C#でデバッグすると空白のフォームが表示されるのはなぜですか?](http://stackoverflow.com/questions/3921300/why-do-i-get-a-blank-form-when- i-debug-in-c) – hankide
このコード行を削除すると意図したとおりに動作するので、私はそうは思わない。 – Elanduir
この行から例外があるかもしれないので、残りのメソッドは実行されません。 – JeffRSon