code disappearing
Posted: Wed May 13, 2020 1:43 pm
I'm having a problem with code disappearing from a form's PRG file if I make any change to the form in the design window. This happens if I add an object or change a property of an object on the form.
I can reproduce the error by doing the following using Visual Studio 2019 16.5.5 and the 2.4a release of X#:
1) create a new Windows forms project
2) place a button on the form
3) double click the button to get to the form code
4) paste the following code into the button's click method
5. Go to the design window and change a property of the button (I've been adding "tag" to the tag property but I think any property change would work)
6. Go back to the code window. On my computer, everything between the line "tmpfilename=openFileDialog1.FileName" and "END CLASS" is now gone.
I can reproduce the error by doing the following using Visual Studio 2019 16.5.5 and the 2.4a release of X#:
1) create a new Windows forms project
2) place a button on the form
3) double click the button to get to the form code
4) paste the following code into the button's click method
Code: Select all
local tmpfilename as string
//tmpfilename=GETFILE("VCX","Select a VCX file to read","Select",0,"Select VCX file")
openFileDialog1.DefaultExt="VCX"
openFileDialog1.Title="Select a VCX file to read"
openFileDialog1.ShowDialog()
tmpfilename=openFileDialog1.FileName
IF NOT EMPTY(tmpfilename) then
txtFileName.text=tmpfilename
showclasses()
ELSE
thisform.lblFileName.caption=""
ENDIF
5. Go to the design window and change a property of the button (I've been adding "tag" to the tag property but I think any property change would work)
6. Go back to the code window. On my computer, everything between the line "tmpfilename=openFileDialog1.FileName" and "END CLASS" is now gone.