When I change vertical size of XNA game window to minimum, it throws ObjectDisposedException for spritebatch, why?
问题 When I resize the game window and the viewport's height becomes 0, GC disposes of spritebatch, I think. Is this what happens? How do I prevent this? 回答1: Form gameForm = (Form)Form.FromHandle(Window.Handle); gameForm.MinimumSize = new System.Drawing.Size(800, 600); Short and sweet! 回答2: I had this same problem and some quick debugging shows that XNA calls UnloadContent and then LoadContent again to reinitialise resources; my guess it it loses the GraphicsDevice or something, hence the reload.