WinUI 3 rounded main window - c#

How to make main window with rounded corners?
I had a look on many videos and steps are quite simple.
check SDK installed
enter image description here
create project c# Windows WinUI
run app - after that a MainWindow appears with rounded corners.
But when project created by me the Mainwindow without rounded corners.
enter image description here
Maybe I have to update windows up to 11?

Maybe I have to update windows up to 11?
Yes, correct.
Only on Windows 11, the system automatically rounds top-level window corners for most apps as explained in the docs.
The APIs that apply rounded corners are not present in Windows 10 and earlier versions.

Related

How to fix c# desktop application form resizing or scaling issue for Windows 11

I have a C# desktop application which is developed in dot net framework 4.6.2. This application is working finr in Win 10. But when same application is run in Win 11, all form controls are disturbed. Like few buttons are totally hidden. Is there any global fix? I don't want to reposition and resize the forms and controlls again for the whole application.
The issue you have is because the Windows 11 computer has a different screen DPI setting. Winforms is notoriously bad at scaling with any setting other than 100%. If you cannot run 100% all the time, then you will have to do some coding magic to detect DPI setting and adjust margins and padding... Or you could redo your UI in WPF, which scales properly at any setting.
Some possible avenues to explore if you rebuild to .NET 4.7+:
https://learn.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8

UWP Adjusting Grid and Other Tools Depending on Resolution

I am creating an app that is going to be put onto a tablet that has a 7 in screen and a resolution of 1280x800. However in the case that we use the app on tablets that have a higher or lower resolution, I would like the entire app to adjust to it accordingly. Is there a way to make my app and all the tools on the page adjust to the resolution of any screen?
Have you tried VisualStateManager? Well, you can learn much about Universal Windows Platform at MVA
Here's the link : https://mva.microsoft.com/en-US/training-courses/windows-10-development-for-absolute-beginners-14541
You can use AdaptiveTrigger to resize or change the layout of your views this feature is only for UWP apps
https://www.microsoft.com/en-gb/developers/articles/week03aug15/designing-with-adaptive-triggers-for-windows-10/
If you are using Windows 8.1 you have 3 projects Windows 8.1(desktop) Windows phone 8.1(Phone) and shared.
You need to create a specific view for each platform with your custom layout .
Maybe if you need to detect the resolution and effective pixels to do something special
var bounds = Window.Current.Bounds;
double height = bounds.Height;
double width = bounds.Width;
With this information can modify your controls depending of the width or height of the screen.
Best Regards

alignment is not getting proper in different resolution

i am working on visual studio 2010.
i created my master form windows state is Maximized
my system resolution is 1366X768 ,,in one button click i am calling 5 forms together into my master form.. but in my system everything getting correct..
but i installed the same application in my client system,,that system resolution is 1024X768
but here my alignment is not getting proper..now my image is getting like this:
so how i can fit my windows form application in all resolution,,if any one know please help me to find out
You basically have two options:
1) Follow Microsoft's instruction on implementing auotscaling for Windows forms applications. (See http://msdn.microsoft.com/en-us/library/ms229605(v=vs.110).aspx)
2) Write your own code to scale the form based on resolution.
============================
Other factors to keep in mind.
If you app is translatable that can affect scaling
A user changing the Windows default font size can have the same affect.
Hope this helps.

Windows Phone 8 tiles

i have recently started to develop apps for Windows Phone 8 after Windows Phone 7, the problem is with creating tiles, i am trying to use the simplest type (iconic tiles) just like we used to do in Windows Phone 7 opened the images from the assets and edited them from there, and modified the app manifest to select the images, but the tile is still showing white blank, i have searched deeply but there does not seem to be any tutorial about this
Make sure you are setting your images to Build Type of Content and that they are actually being included in your xap.
For a complete discussion about Tiles start: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202948(v=vs.105).aspx
Iconic Tiles cannot be colored. They are monochromatic. That is why you got blank white image. The only shape on transparent background is used by Windows Phone to show such kind of tiles.
To get colored Tile you have to use Flip Template for it.

Issues with Magnification API

I am having issues with the Magnification API provided my Microsoft. This is an API that is written in C++ so to use it with C# you must use a series of .dll imports as described in this question.
My issue came after I had the magnification working. I was using my mouse to magnify a predefined area of the screen, the magnification was set in a rectangle, the rectangle filled a WinForm, I placed the form on top of my mouse (mouse in center of form), and the form would follow my mouse around the screen.
About 80% of the time, the app will launch with a black screen. I tried many different types of updates but can't find a fix. The magnification will not show up, it will only show a black screen. Nothing on the from will show up, only a black screen. In summary, only a black screen will show up, BECAUSE of the Magnification API.
The problem has to deal with Windows 32 and 64 bit systems. There's a Forum post about this problem.
I changed the Build of my project from x86 to Any CPU - fixed the problem, no coding needed.
In Visual Studio 2010: In the Solution Explorer right click your project > choose Properties > choose the Build tab > and under Platform Target choose "Any CPU".

Categories