Example 8 Divide the sides of a triangle into $n$ equal parts, and draw lines parallel to the other two sides through the division points. Let the number of parallelograms formed inside the known triangle be denoted as $S$. Find the expression for $S$. (1991, 23rd Canadian Mathematical Olympiad).
Solution 1 As shown in Figure 1-16, a parallelogram with sides not parallel to $AC$ is determined by four integers $a, b, c, d$ (taking $\frac{1}{n} BC$ as the unit length), and $a \geqslant 0, b \geqslant 0, c \geqslant 1, d \geqslant 1, 2 \leqslant a+b+c+d \leqslant n$. Let $x_{1}=a, x_{2}=b, x_{3}=c-1, x_{4}=d-1$ and $x_{1}+x_{2}+x_{3}+x_{4}=k$, then $0 \leqslant k \leqslant n-2$. The number of non-negative integer solutions to the equation $x_{1}+x_{2}+x_{3}+x_{4}=k$ is $C_{k+3}^{3}$. Therefore, the number of parallelograms with sides not parallel to $AC$ is $S_{1}=\sum_{k=0}^{n-2} C_{k+3}^{3}=C_{4}^{4}+\sum_{k=1}^{n-2}\left[C_{k+4}^{4}-C_{k+3}^{4}\right]=C_{n+2}^{4}$. Hence, the total number of parallelograms in the figure is $S=3 S_{1}=3 C_{n+2}^{4}$.

Solution 2 As shown in Figure 1-16, extend $BA$ to $M$ such that $AM=\frac{1}{n} BA$, and extend $BC$ to $N$ such that $CN=\frac{1}{n} BC$. Suppose the points dividing $MN$ into $n+1$ equal segments (including $M, N$, a total of $n+2$ points) are sequentially labeled as $0,1,2, \cdots, n+1$. Thus, each side of the parallelogram intersects $MN$ at 4 points $i, j, k, l (0 \leqslant i<j<k<l \leqslant n+1)$. Conversely, from the $n+2$ equally divided points on $MN$, any 4 points $i, j, k, l (0 \leqslant i<j<k<l \leqslant n+1)$ can be chosen, and by drawing lines parallel to $AB$ through $i, j$ and lines parallel to $BC$ through $k, l$, a parallelogram in the figure can be obtained. This correspondence is one-to-one, so the number of parallelograms with sides not parallel to $AC$ is $S_{1}=C_{n+2}^{4}$, and thus the total number of parallelograms in the figure is $S=3 C_{n+2}^{4}$.