How do I reduce window size in the C# WPF program?

Asked 2 years ago, Updated 2 years ago, 78 views

Hello, everyone

C# Press button in WPF program

I want to make the window smaller.

Make a button to press.

private void button1_Click(object sender, RoutedEventArgs e)
{

}

I don't know, I don't think I should put something in this function.

c# wpf

2022-09-21 19:17

1 Answers

private void button_Click(object sender, RoutedEventArgs e)
{
    Application.Current.MainWindow.Height = 150;
}

This makes the size smaller.


2022-09-21 19:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.