I took a cross-country flight over the weekend with flight following. I was given the squawk code and subsequent traffic advisories, and about 10 miles from my Class D destination was told to contact the tower. I contacted the tower, keeping the original squawk code, and requested touch and go's at the airport. I did several T&Gs and then requested to depart the Class D. At no point was I asked to squawk VFR. When the controller asked me to 'proceed on course', I changed the squawk code to 1200 even though he didn't mention it. In a situation like this, when is the appropriate time to squawk VFR if a controller doesn't mention it or say frequency changed approved?