我有一个问题,因为我希望将 PictureBox 放在绘制为钢琴五线谱的面板上。我遇到的问题是在使用.Transparent
它时只是给了我控制颜色表格,这是不正确的,有一个带有线条的五线谱。我能做些什么?
编辑:
汉斯,如何编写代码才能使所有内容都成为面板?代码:汉斯,如何编写代码才能使所有内容都成为面板?
代码:
class MusicNote : PictureBox
{
public string path = "ImagesName\\";
public string noteShape = "";
public int time = 0;
public MusicNote(int iTime, string iNoteShape, int x, int y) : base()
{
noteShape = iNoteShape;
time = iTime;
Enabled = true;
Location = new Point(x, y);
Size = new Size(35, 35);
Image NoteBmp = Image.FromFile(path + noteShape + ".png");
Image = NoteBmp;
}
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
}
}