您好我正在尝试在运行时删除Image控件...
var modifiedPic = (DataDynamics.ActiveReports.Picture)reportSection.Controls[controlIdx];
modifiedpic.ResetImage()
仅重置图像,但不会删除控件。
我也试过modifiedPic.Image.RemovePropertyItem(771);
这也不起作用。有没有办法在运行时删除控件?
另外,我想设置control.Location.X
值。如何实现这一目标?
答案 0 :(得分:1)
试试这个。 这个Shoud删除了控件。
var modifiedPic = (DataDynamics.ActiveReports.Picture)reportSection.Controls[controlIdx];
reportSection.Controls.Remove(modifiedPic);
答案 1 :(得分:1)
用于分配location.X和location.Y点我们必须定义
System.Drawing.PointF x= new System.Drawing.PointF();
var modifiedPic = DataDynamics.ActiveReports.Picture)reportSection.Controls[controlIdx];//TargetControl:
var modifiedPic1 = (DataDynamics.ActiveReports.Picture)reportSection.Controls[controlIdx];//Control to get value of X:
x.X = modifiedPic1.Location.X;
modifiedPic.Location = x;