In a large saucepan, melt butter or margarine. Stir in flour and garlic powder. Add milk all at once. Cook, stirring constantly, over low heat until melted.
Stir in both cheeses until melted. Stir in corn and ham, then transfer mixture to a 2-quart casserole dish.
Bake at 350°F for 45 minutes.
