Heat the oven to 350°F or 175°C. Line an 8-inch square pan with parchment paper, leaving an overhang on two sides for easy removal.
Mix flour, sugar, baking powder, and salt in a large bowl. Cut in the cold butter, then stir in the egg until the mixture forms coarse, slightly moist crumbs.
Press about two-thirds of the crumb mixture firmly into the bottom of the pan. Use a flat-bottomed measuring cup to create an even base without making it overly compact.
Toss the diced apples with brown sugar, cinnamon, lemon juice, and cornstarch. Spread the fruit over the crust, then scatter the remaining crumbs across the top.
Bake for 42 to 46 minutes, until the surface is golden and the apple layer is tender. Cool completely in the pan before lifting the slab out.
Stir powdered sugar, milk, and vanilla until smooth, then drizzle it over the cooled bars. Allow the glaze to set before cutting into 16 squares.