Hi Dick,
first, don't forget that WinForms will do a lot of things for you, so if you remove/change some code, the generated code is not aware of that, and still rely of the previous version...
That said, you can:
Double click on a Form definition, this will open the designer. The designer rely on the InitializeComponent that (most of the times) is inside the .designer.prg file. My advice it to NOT touch this file, but.. you can if you know what you are doing.
If you want to look at your code, just Right-Click on the file in the Solution Explorer, and select View Code.
Now, let say that you inadvertently click on a button, the Designer will generate code to "link" the ClickEvent of this button to a piece of code, and that piece of code will appear in the UserCode prg (the main Form prg file)
Now, if YOU remove this piece ot the code, the designer is not aware of that and the link persist; and this will break the designer
So, to achieve that task, the best way is to NOT remove that code manually, but let the designer do it.
For that, go back to the Designer; Single-Click on the Button; Then look at the Properties area (usually down right in the VS area), there change from Properties view to Events view (by one of the buttons), and search the event that you selected. Then Right-Click on it, and select Reset. You're done !! The Designer will remove the link (and remove the generated code if you did not touched it)
The other way, to achieve that, is to open the .designer.prg file, search the button initialization code, and remove the line with the definition of the Click Event with the EventHandler. But again, be aware that you may break things if you remove the wrong line.
HTH,
Fab