Topmost
属性控制窗口置顶,WindowState
属性控制窗体最大化,最小化,还原等状态。
private void SetTopMost_Checked(object sender, RoutedEventArgs e) { Topmost = SetTopMost.IsChecked is true; } private void btnMinsize_Click(object sender, RoutedEventArgs e) { WindowState = WindowState.Minimized; } private void btnNormal_Click(object sender, RoutedEventArgs e) { WindowState = WindowState.Normal; } private void btnMnsize_Click(object sender, RoutedEventArgs e) { WindowState = WindowState.Maximized; }