Prince George, Princess Charlotte and Prince Louis watched a performance of Pantoland at the London Palladium with their parents in the royal box.
In a speech before the show, the duke called Dame Barbara "a legend".
It was the Cambridges' first red carpet engagement as a family of five.
Their visit followed the news that the actress, best known for her roles in EastEnders and the Carry On films, had died aged 83.
When the Cambridges first arrived at the Palladium, George, seven, Charlotte, five, and two-year-old Louis stopped briefly to watch actors dressed as elves entertaining the guests on the red carpet.
Before the show, Matt Ridsdale, executive director of National Lottery operator Camelot, which has supported the pantomime, introduced Prince William and quipped: "As this is panto, I'm very conscious of who's behind me."
The duke said: "Before I go on, I want to pause and pay tribute to a true national treasure, Dame Barbara Windsor, who so sadly passed away last night.
"She was a giant of the entertainment world, and of course a legend on pantomime stages across the country, including here at the London Palladium.
"And I know we'll all miss her hugely."
The duke said it was a "very special performance" because of the key workers in the audience.
"You include community workers, volunteers, teachers, NHS staff, representatives from the emergency services and military, researchers working on the vaccine, people helping the homeless, those manning vital call centres, and staff from a wide range of frontline charities - to name but a few," he said.
"You have given your absolute all this year and made remarkable sacrifices."
Earlier this week the duke and duchess travelled around Great Britain on the royal train to thank key workers for their efforts during the pandemic.
The difference between a welfare state and a totalitarian state is a matter of time.