C
Charles A. Lackman
Hello,
I am working on a program that Adds a Tab page with a picturebox inside it
for each page of a TIF and it works well. If I have a 3 page TIF the
application add 3 TabPages and inside each TabPage Adds a PictureBox and
properly displays the Images. I also do other things like add textboxes and
drawing with the mouse which works pretty good.
The problem I am having is when I want to delete a page. When the
PictureBox is Disposed and I remove the TabPage. Somehow the PictureBox is
still seen as existant. Here is an example.
The PictureBox is as Array ReDim PictureBox(3) ' PictureBox
And so are the TabPages ReDim TabPage(3) ' TabPage
PictureBox(TabControl.SelectedIndex).Dispose() 'In this example the
selected index is 0
TabControl.TabPages.Remove(TabControl.SelectedTab)
The interface looks the way it should but,
After I Dispose the PictureBox and Remove or Dispose the TabPage and do the
following:
TestPicBox.image = PictureBox(0).image
An image show's up in TestPicBox, I can even assign it a new image
PictureBox(0).image = NewImage
Shouldn't it be distroyed?
Why is it still there?
Any suggestions will be greatly appreciated.
Thanks
Chuck
I am working on a program that Adds a Tab page with a picturebox inside it
for each page of a TIF and it works well. If I have a 3 page TIF the
application add 3 TabPages and inside each TabPage Adds a PictureBox and
properly displays the Images. I also do other things like add textboxes and
drawing with the mouse which works pretty good.
The problem I am having is when I want to delete a page. When the
PictureBox is Disposed and I remove the TabPage. Somehow the PictureBox is
still seen as existant. Here is an example.
The PictureBox is as Array ReDim PictureBox(3) ' PictureBox
And so are the TabPages ReDim TabPage(3) ' TabPage
PictureBox(TabControl.SelectedIndex).Dispose() 'In this example the
selected index is 0
TabControl.TabPages.Remove(TabControl.SelectedTab)
The interface looks the way it should but,
After I Dispose the PictureBox and Remove or Dispose the TabPage and do the
following:
TestPicBox.image = PictureBox(0).image
An image show's up in TestPicBox, I can even assign it a new image
PictureBox(0).image = NewImage
Shouldn't it be distroyed?
Why is it still there?
Any suggestions will be greatly appreciated.
Thanks
Chuck