【发布时间】:2018-09-23 22:06:36
【问题描述】:
我正在使用标签的预设制作一个无限的随机平台游戏(在 mircosoft Visual Studio 中)。
我的“计划”是创建一个新标签,使用预设中标签的所有属性(当然还要改变位置)。这是我的代码(假设“Platform1 是预设标签):
Label newLabel = new Label();
newLabel.AutoSize = false;
newLabel.BackColor = Platform1.BackColor;
newLabel.Top = Platform1.Top-420;
newLabel.Left = Platform1.Left;
newLabel.Size = Platform1.Size;
我的问题是 newLabel 没有显示。
我尝试了 Visible = true 和 BringToFront,但没有成功。
我们将不胜感激!
【问题讨论】:
-
这是 Windows 窗体吗?如果是这样,您应该使用 Windows 窗体对其进行标记。如果没有,请使用您正在使用的任何库/框架对其进行标记
标签: c#