-2

The Official UWP ProgressBar Control:https://learn.microsoft.com/zh-cn/windows/apps/design/controls/progress-controls

Demo show : enter image description here

But what I get is like this: enter image description here

How can I change it?

  • You've not included any code at all, but you're expecting us to tell you what's wrong with it to cause the problem you're having. How do you expect that to work? If you call your doctor and say *I have these strange looking spots all over my body. How do I make them go away?*, your doctor is going to want a lot more information before they tell you how to treat it. We're the same way - we need the details before we can tell you how to solve the problem. – Ken White Feb 24 '23 at 04:57

1 Answers1

0

I could reproduce your problem. So there are two progress bars: the default one (dotted) is native uwp and the other one(the one you would like to get) comes with the Winui2 nuget package.

How to install and add the nuget:

  1. rightclick your project in solutionexplorer
  2. click on manage nuget packages
  3. search for the Microsoft.Ui.Xaml nuget and install it
  4. Add this code to your app.xaml inside the application tags to reference the winui2 controls:
<Application.Resources>
     <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</Application.Resources>
  1. add a reference to the Microsoft.UI.Xaml.Controls namespace as muxc to your mainpage:
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
  1. Add the progressbar from the muxc namespace:
<muxc:ProgressBar Width="150" IsIndeterminate="True"/>
FrozenAssassine
  • 1,392
  • 1
  • 7
  • 16