We consider a non- autonomous form a : [0, T] x V x V -> C where V is a Hilbert space which is densely and continuously embedded in another Hilbert space H. Denote by A(t) is an element of L(V, V') the operator associated with a(t, ., .). Given f is an element of L-2 (0, T, V'), one knows that for each u0 is an element of H there is a unique solution u is an element of H-1 (0, T; V') boolean AND L-2 (0, T; V) of over dot (u)(t) + A(t)u(t) = f(t), u(0) = u0. This result by J. L. Lions is well known. The aim of this article is to find a criterion for the invariance of a closed convex subset C of H; that is, we give a criterion on the form which implies that u(t) is an element of C for all t is an element of[0, T] whenever u0 is an element of C. In the autonomous case for f = 0, the criterion is known and even equivalent to invariance by a result proved by Ouhabaz 'Invariance of closed convex sets and domination criteria for semigroups', Potential Anal. 5 (1996) 611-625. See also Ouhabaz 'Analysis of heat equations on domains', London Mathematical Society Monographs. Princeton University Press, Princeton, NJ, 2005. We give applications to positivity and comparison of solutions to heat equations with non-autonomous Robin boundary conditions. We also prove positivity of the solution to a quasi-linear heat equation.