Closing a Frame
BlitzMax Forums/Brucey's Modules/Closing a Frame
| ||
I want to close Frame2 when a button is clicked. I thought frame2.show(False) would have been enough to bring Frame1 to the front again. But i get an "Unhandled Exception: Attempt to access field or method of Null Object" testFormOpening_Main.bmx testFormOpening_GUI.bmx Regards glenn |
| ||
The variable/field frame2 in your Button2Clicked method is Null. You never set it to anything. |
| ||
true. the question still remains though. i want to unshow frame2 so frame1 reappears, or destroy frame2 if necessary, like clicking on the x in the top right hand corner. I know this should be incredibly simple but ... i don't appear to be doing "simple" today. |
| ||
I trust that your frames are just basic examples, as they are otherwise practically identical? Anyhoo, how about : Method Button2Clicked(event:wxCommandEvent) Close() End Method What were you intending your frame2 field in MyFrame2 to represent? itself, or a third frame? |
| ||
i put the frame2 field in because it complained on the frame2.show(false) line without it. amazingly the close() command on its own never even occurred to me. i was trying to reference it back to itself in my previous attempts. Many thanks |