But the duke admitted he would be "nervous" about the pressures a gay royal might face.Read more
Prince William, Duke of Cambridge
But he said he would be worried "how much harder their life could be" because of discrimination.
The Duke and Duchess of Cambridge are set to join the Queen on the first day of Royal Ascot.
Prince William and his wife Kate will be hosted by the monarch in the royal box as the five-day event kicks off.
The Queen said in a statement on the official opening programme it was "truly exciting" to see global competitors take part in the races, as a "strong international competition adds further interest and fascination".
Up to 300,000 people are set to attend the 300-year-old event, where, the Queen said, the "horses remain the stars".
The duke and duchess will present the winning trophies in the King's Stand Stakes - a group one race - while acclaimed actor Sir Derek Jacobi will hand out the prizes for the Wolferton Stakes.
Cumbria will have another royal visit next month.
On 2 July, the Princess Royal will be in West Cumbria, to officially open Campus Whitehaven, on Red Lonning in the town.
Also, at Lillyhall, in her role as president of the City and Guilds of London Institute, Princess Anne will open the Gen2 Head Office on Blackwood Road.
She follows the Earl of Wessex who's visiting the Furness area today, and the Duke and Duchess of Cambridge who were in the county earlier this week and who, after all the high-profile engagements, enjoyed a walk guided by senior staff from the Cumbria Wildlife Trust.
The Duke of and Duchess of Cambridge enjoyed cake and discussion of sheep farming in the Lake District on the second half of their Cumbrian visit, at Deepdale Farm in Patterdale.
William's father, Prince Charles, is known for his interest in hill farming, and he visited Deepdale, which has been run by the Brown family since the 1950s, in 2009.
Later the royal visitors were shown around the farm, which is home to 600 ewes and other stock, and were shown some of the skills of dry-stone walling.
Journalist, BBC Radio Cumbria
The Duke and Duchess of Cambridge have been enjoying a chat with local people and a taste of cheese on their visit to Keswick.
The origin of Keswick's name is disputed by academics, but one version is that it was the Saxon for a farm where cheese was made, and the first stall visited by the Duke and Duchess was selling cheese.
They also visited a stall selling meat from Low Howgill Farm at Appleby.
The couple then spent some time in a marquee talking to volunteers from the town's mountain rescue team, young people who set up their own team of mental health "first aiders", and staff from the Cumbria Community Foundation, which has just won a royal award for charities.