with other controls it easier than a picturebox or image control
you would need add a control to replace the deleted one, then loop through all the controls from the new one, in this case 3 to 5 and copy the all the required properties form the one above probably have to copy top,left,height,width,picture,image,font (all properties), autoredraw, maybe someothers, any that are default from creation should not need changing
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
yes it work for picturebox, just more properties to copy, especially if pictureboxes have different sized pictures or images
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
ok , here is the thing , I use vsflexgrid for layers , every layer has it's properties , and within : the color
like picture below
ok , I make control array on picturebox , so when user press new layer button , new layer will be added with editable colorful picturebox , the thing is when user delete current layer ... there will be one more picturebox than the already rows I have
One minor thing, rather than removing and re-adding, I would recommend that you remove the last picturebox instead, then update the properties as apt for the ones down to the 'removed' one.