![| Embarcadero RAD Studio Delphi C++Builder Blogs How To Control Windows 11 Rounded Corners In Your App header image](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/09/hero_image-3363249.png?resize=1140%2C694&ssl=1)
As I hope you’re aware by now – RAD Studio 11 Alexandria is now available! The Windows IDE contains a whole ton of features, and it’s launching just ahead of Microsoft’s official release of the beautifully redesigned Windows 11. We wrote about the many great things contained in Windows 11 here on the blog before, and how behind that gorgeously aesthetic user interface are a few traps and pitfalls which may be a problem for older legacy apps and hardware.
![| Embarcadero RAD Studio Delphi C++Builder Blogs How To Control Windows 11 Rounded Corners In Your App notepad rounded corners](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/09/notepad-rounded-2558891.png?resize=414%2C187&ssl=1)
One of the most obvious user interface changes is the fact that almost all app windows and many user interface controls will get a rounded corner effect applied to them. The amount of rounding of the application’s forms and things like text boxes, panels, and group boxes will vary. Microsoft go into a lot more detail on how it will affect user interface components here in this article.
They also have an article, here, which describes how rounding of the application forms occurs and also how to turn that rounding feature on or off. Microsoft recognizes that some app windows are not going to work very well with rounding applied to the caption bar – for example, tool window type application frames, which typically have a very narrow height and custom-drawn window icons.
Thinking ahead, Windows 11 provides a fairly easy-to-use Windows API that allows you full control over that rounding behavior – to turn it off, on, or ask Windows 11 to round the windows with a smaller radius.
Small Windows 11 Rounding Normal Windows 11 rounding
The question came up during the RAD Studio 11 launch Q & A whether the Embarcadero team had an example of using that API. Jim McKeeth pasted a short example of how to do it in the question window but it was a little hard to read and only a partial example so I’ve taken that answer and built a more complete demo for you to download and play with. Just for fun it also shows Windows notifications using the TNotificationCenter component because if we’re going to be modern we might as well embrace a few of the other cool modern Windows things Delphi makes very easy. 😋
![| Embarcadero RAD Studio Delphi C++Builder Blogs How To Control Windows 11 Rounded Corners In Your App test Delphi 11 App](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/09/Screenshot-2021-09-10-131512-1869607.png?resize=649%2C472&ssl=1)
On versions of Windows before Windows 11 the API call will have no effect and your app Windows will still look the same. On Windows 11 the example app controls the main form Window based on your choices from a radio group. I’ve created a universal unit with a simple call in there – all you need to do is pass it a Window handle and Windows 11 will do your bidding.
![| Embarcadero RAD Studio Delphi C++Builder Blogs How To Control Windows 11 Rounded Corners In Your App RAD Studio 11](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/09/Screenshot-2021-09-10-131107-9058461.png?resize=750%2C422&ssl=1)
The example app is written in the new RAD Studio 11 Alexandria, of course, but it should work on earlier versions of Delphi. To use the code in your own apps simply download the source repository from the GitHub link below and include the “delphi_rounded_corners.pas
” unit in your apps and make the procedure call.
You can download the full source for the example RAD Studio 11 Delphi example application from here: https://github.com/checkdigits/rounded_corners
RAD Studio 11 Alexandria is available now! It’s a fantastic tool for creating all types of applications which can run natively on Windows, macOS, Linux, iOS and Android. Why not download a free trial and check it out today?
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition
Does Delphi 11 utilize the new Windows 11 context menu look? It’s too spacious for my taste btw… and slower too.
Windows 11 is still in the beta stage at the time of writing and there are several issues Microsoft are working on such as the new ‘centered’ task bar not being centered (which is a bit of a highly visible issue). When the full release of Windows 11 comes out you’ll be able to see which bits of it directly affect your apps. The context menus are part of Windows 11’s way of rendering things so for VCL apps that usually means they inherit some or all of that behavior, but not always. Let us know how you get on.