I have a TableLayoutPanel with a grid of PictureBox controls within it. I’m trying to find a shortcut way to change them all to Label controls instead of manually deleting each one and placing new controls in each cell.
I thought I could go into the designer code and find/replace PictureBox with Label, but now I get an
“Object does not match target type”
error in Visual Studio’s error list. I can’t view the designer page now either. Is this not allowed? If it is allowed, what’s the right way to do it?
If you take a closer look at the generated code:
label1:pictureBox1:My guess is that the
is changed by you into something like:
which doesn’t work, and results in designer issues.
Object does not match target type.so, apply the changes you already did, remove the lines like:
and I think you’re good to go.