Removing Tabpages Trouble

daveh541

Member
Joined
May 29, 2003
Messages
20
An odd thing occurs when I remove a tabpage programmatically from my tabcontrol (odd to me, maybe not to others), the program loses its abillity to close.

Cant click the little X button, no alt-f4, cant use my programs file menu- exit....

I have to to go into task manager and end the task.

Any ideas?

This only occurs when I keep the remove code in. If I set the File Menu - Exit to application.exit instead of me.close() it can quit, but Im wondering if something is being overwritten, and how or if I can stop it.

Thanks for any help.
 
This is a bug in windows forms that occurs when you remove a control that contains the focus. To work around it, set the focus to another control outside the control youre removing just before you remove it.
 

Similar threads

Back
Top