473,499 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Picture Boxes

Hi

I wonder if someone can help with this, because there's something I'm
not understanding right.

I've got a List Array of PictureBoxes.

If I call PictureBoxListArray.Clear(), and then MainForm.Invalidate(),
the picture boxes remain visible on the form.

I'm not sure why!

What's the best way to get rid of them?

I've tried ((PictureBox) PictureBoxListArray[i]).Dispose() - for each
of the picture box objects, but that seems to cause problems...

Any advice greatly appreciated!

Thanks.

Regards,

Jerry
Nov 15 '05 #1
1 1793
Jerry,

The reason for this is that you are not removing the picture box
controls from the control that is hosting them. Basically, if the boxes are
on the form, you have to do the following for each picturebox:

- Call the Remove method on the ControlCollection instance returned by the
Controls property.
- Remove the reference to the control from the PictureBoxListArray.
- Call Dispose on the control (if you don't need them anymore).

Hope this helps.

"Jerry S" <je***@philosophers.co.uk> wrote in message
news:21********************************@4ax.com...
Hi

I wonder if someone can help with this, because there's something I'm
not understanding right.

I've got a List Array of PictureBoxes.

If I call PictureBoxListArray.Clear(), and then MainForm.Invalidate(),
the picture boxes remain visible on the form.

I'm not sure why!

What's the best way to get rid of them?

I've tried ((PictureBox) PictureBoxListArray[i]).Dispose() - for each
of the picture box objects, but that seems to cause problems...

Any advice greatly appreciated!

Thanks.

Regards,

Jerry

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6439
by: daimler | last post by:
help!!!!!!!! i did a for i=1 to picture1.scaleheight/2 picture1.pset (i,i) next i and the pset is shown on the picture
10
9477
by: Chris Coho, Jr. | last post by:
Ok, I'll explain the whole problem because there may be several ways to solve this and hopefully someone knows one. What I'm doing is creating a specialty template editor, similar to say a corel...
2
2552
by: beanimanius | last post by:
working with about 100 picture boxes (not very big, 42X8) 1 image list of 5 pictures hopefully 1 context menu how do you program a contex menu so that it knows what picture box you are clicking...
2
1360
by: Bwells | last post by:
Sorry for the legacy question (VB6) but the program I need to implement printing on has not been converted to .Net yet. I have a form with 4 Picture Boxes on it. These boxes are used as a...
0
926
by: T Clancey | last post by:
Hi. I'm trying to put together a very simple label designer to add to a project, this will allow users to enter text data. I can DrawSting the data into the picture boxes as required, but I...
2
2743
swatmajor1
by: swatmajor1 | last post by:
I have been creating a basic sodoku game as a school assignment. Basically to load a puzzle, a pre-set arrangment of numbers are loaded into a hidden picture box array called "Picsolution". What I...
1
1811
by: Jeff Williams | last post by:
I am trying to get the following to work so would like some guidance on how to achieve what I need. 1. I have a form which has a tab control. 2. On the 4th TabPage I have 5 picture boxes. 3....
12
4089
by: akynaya | last post by:
I have several image boxes... and one picture box as a container... The problem is that... when i try to save the images.... the images doesn't appear. for the image box code i used...
1
3537
by: orson4music | last post by:
I have two picture boxes on my form. One on top of the other. The top most picture box's movement is restricted within the picture box below making it look like the top most picture box is contained...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.