Preheat oven to 350°F (175°C) and lightly grease a 2-quart casserole dish.
Peel and thinly slice 2 pounds of potatoes, dice 1 1/2 cups of cooked ham, and finely chop 1 small onion.
Layer half of the potato slices in the casserole dish, then sprinkle with half of the ham and onion; repeat with remaining potatoes, ham, and onion.
Melt 3 tablespoons butter in a saucepan over medium heat, stir in 3 tablespoons flour, and cook for 1 minute.
Gradually whisk in 2 cups milk, simmer until thickened, then season with 1/2 teaspoon salt, 1/4 teaspoon pepper, and 1/4 teaspoon paprika.
Remove from heat and stir in 1 cup shredded sharp cheddar cheese until melted and smooth.
Pour cheese sauce evenly over the layered potatoes, ham, and onion in the casserole dish.
Cover with foil and bake for 60 minutes; uncover, sprinkle with 1/2 cup grated Parmesan cheese, and bake for an additional 20-30 minutes until golden brown.
Let cool for a few minutes before serving.