Pergunta

Hi I'm trying to remove an Image control at runtime...

var modifiedPic = (DataDynamics.ActiveReports.Picture)reportSection.Controls[controlIdx];

modifiedpic.ResetImage() only resets the image but doesn't remove the control.

I also tried modifiedPic.Image.RemovePropertyItem(771);

This didn't work either. Is there any way to remove the control at runtime?

Also I want to set the control.Location.X value. How can this be achieved?

Foi útil?

Solução 2

for assigning the loaction.X and location.Y points we have to define

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;

Outras dicas

Try This. This Shoud remove the control.

var modifiedPic = (DataDynamics.ActiveReports.Picture)reportSection.Controls[controlIdx];
reportSection.Controls.Remove(modifiedPic);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top