怎么说提创建的图片框是formLoad?

时间:2019-05-23 10:27:37

标签: c# forms

我已经在Formload中创建了一个图片框,该图片框旨在像一个启动器屏幕,并且希望它在单击按钮时消失,但是出现错误“名称在当前上下文中不存在”

private void Form1_Load(object sender, EventArgs e)
        {
            var picture = new PictureBox
            {
                Name = "ekranStart",
                Size = new Size(1100, 700),
                Location = new Point(0, 0),
                BackgroundImageLayout = ImageLayout.Tile,
                Image = Image.FromFile("../obrazy/start.png"),

            };
            this.Controls.Add(picture);
            picture.BringToFront();
}

0 个答案:

没有答案