If you want to open the winform window in wpf and display the progress bar normally at runtime, you could add the following code to your project.
System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
The content comes from the document Application.SetCompatibleTextRenderingDefault(Boolean) Method:
You can only call this method before the first window is created by your Windows Forms application.
I added the above code in the MainWindow method instead of Form1.Designer.cs and it works normally
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
}
}
The picture of result:
If the answer is the right solution, please click Accept Answer and kindly upvote it. If you have extra questions about this answer, please click Comment.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.