Automatically close a vtk window before another vtk window is open
07:14 16 Oct 2015

I have a Visual studio MFC project which is integrated with VTK. A Button click in my project will generate a VTK window, and I want to close that VTK window when I click the same button for the second time, and open a new VTK window.

My current project will generate VTK windows for each button click without closing the previously opened windows.

My button contains the following code lines to call the .cpp file where I have written down the code for the VTK window.

RectangleShape C1;
C1.RectangleGraphic(redVal,greenVal,blueVal,length,Height,Width);
c++ visual-studio-2008 mfc vtk