To regain the space from a partition you must delete it of reduce its size. However, you can only expand a partition if the free space is contiguous with the partition you want to expand. If you have reduced the size of your D: partition but the free space is not next to the C: partition, you will not be able to expand C: to use this free space. First you will need to move D:.
Is there a reason why you did not just delete the D: partition?