控件太多了。 把Flash嵌到你WinForm界面上可不可以? 呵呵。。偷懒的方案。不过如果可行的话,还是可以减轻你很多工作量的。用Flash也可以调用C函数。如果用WinForm的话,这样用控件肯定是不合适的。因为每一个Control都是一个WIN32的WINDOW。都是一个重量级对象。所以解决方案就是。自己设计控件。。比如 class Control : IReander,IMyControl,, { private System.Windows.Forms.Control parent; private int x; private int y; } class Button : Control { void OnPaint(Graphics g) } 明白了吗
class Control : IReander,IMyControl,,
{
private System.Windows.Forms.Control parent;
private int x;
private int y;
}
class Button : Control
{
void OnPaint(Graphics g)
}
明白了吗
{
string[] btnHname = { "btnH01", "btnH02", "btnH03", "btnH04", "btnH05", "btnH06", "btnH07", "btnH08", "btnH09", "btnH10", "btnH11", "btnH12", "btnH13", "btnH14", "btnH15", "btnH16", "btnH17", "btnH18", "btnH19", "btnH20", "btnH21", "btnH22", "btnH23", "btnH24", "btnH25", "btnH26", "btnH27", "btnH28", "btnH29", "btnH30", "btnH31", "btnH32", "btnH33", "btnH34", "btnH35", "btnH36", "btnH37", "btnH38", "btnH39", "btnH40", "btnH41", "btnH42", "btnH43", "btnH44", "btnH45", "btnH46", "btnH47", "btnH48", "btnH49", "btnH50", "btnH51", "btnH52", "btnH53", "btnH54" };
string[] btnHtext = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54" }; Button BD_H;
for (int i = 0; i < btnHnum; i++)
{
BD_H = new Button();
BD_H.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
BD_H.ForeColor = System.Drawing.Color.Black; int j = i % 10; if (i < 10)
{
BD_H.Location = new System.Drawing.Point(j * 7 + j * 25, 20);
}
else if (i >= 10 && i < 20)
{
BD_H.Location = new System.Drawing.Point(j * 7 + j * 25, 45);
}
else if (i >= 20 && i < 30)
{
BD_H.Location = new System.Drawing.Point(j * 7 + j * 25, 70);
}
else if (i >= 30 && i < 40)
{
BD_H.Location = new System.Drawing.Point(j * 7 + j * 25, 95);
}
else if (i >= 40 && i < 50)
{
BD_H.Location = new System.Drawing.Point(j * 7 + j * 25, 120);
}
else
{
BD_H.Location = new System.Drawing.Point(j * 7 + j * 25, 145);
}
BD_H.Name = btnHname[i];
BD_H.Size = new System.Drawing.Size(25, 20);
BD_H.TabIndex = i;
BD_H.Text = btnHtext[i];
BD_H.Click += new EventHandler(BD_H_Click);
//+= new System.EventHandler(btnHname[i] + "_Click");
BD_H.UseVisualStyleBackColor = true;
groupHong.Controls.Add(BD_H);
} }
当然也有极少有。。比如报表控件,,如果每一个元件都用一个窗口,如里面的TextBox,Picture,Line等等。。当报表中元素一多,软件影响会变的非常慢占资源很多。
如果用常规的控件方法(包括1楼说的自己设计控件)是不是可以解决闪烁现象.如果不行,
我会坚持我的意见,用flash.(真不知对方为什么不想用flash,难道和Macromedia有仇?)
不过,能用Flash尽量还是用Flash,用一个ActivateX,在WinForm上,也可以交互的。我倾向于你用这种方案。