相关疑难解决方法(0)

Wpf控制大小到内容?

如何使WPF控件根据其中的内容更改其大小?

wpf autosize wpf-controls

65
推荐指数
2
解决办法
10万
查看次数

如何制作全屏模式,而不使用以下任务栏覆盖任务栏:wpf c#

我需要在WPF应用程序中更改Windows任务栏.为此我设置WindowStyle="None",这意味着禁用Windows任务栏,并使用按钮进行自定义任务栏以恢复,最小化和关闭应用程序.现在我的问题是如果应用程序处于最大化模式,那么我无法在Windows上看到开始菜单.

我在这里找到了一个类似的问题,但是当我尝试这个代码时它没有编译.全屏模式,但不要覆盖任务栏

如何创建自己的任务栏并在最大化时能够看到Windows开始菜单?xaml中是否有可以设置的属性窗口?

c# wpf xaml taskbar startmenu

10
推荐指数
3
解决办法
1万
查看次数

WPF窗口大小有监视器大小

我是WPF的新手,我想制作一个具有最大尺寸(显示器尺寸)的窗口.

Window的XAML代码是这样的:

<Window x:Class="WpfApplication1.Stop"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Stop" Height="{Binding}" Width="{Binding}" Background="Black" WindowStartupLocation="CenterScreen" WindowStyle="None" ResizeMode="NoResize" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="260" d:DesignWidth="348" SizeToContent="WidthAndHeight">
    <Grid>
        <Button Content="Ok" Height="25" HorizontalAlignment="Left" Margin="194,36,0,0" Name="button1" VerticalAlignment="Top" Width="38" Click="button1_Click" />
        <TextBlock Height="17" HorizontalAlignment="Left" Margin="18,16,0,0" Name="textBlock1" Text="Introduceti parola:" VerticalAlignment="Top" Width="246" FontSize="14" Foreground="White" />
        <PasswordBox Height="25" HorizontalAlignment="Left" Margin="12,36,0,0" Name="passwordBox1" VerticalAlignment="Top" Width="176" />
    </Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)

打开此窗口的C#代码如下:

Stop a = new Stop();                   
a.Show();
a.Width = System.Windows.SystemParameters.PrimaryScreenWidth;
a.Height = System.Windows.SystemParameters.PrimaryScreenHeight;
Run Code Online (Sandbox Code Playgroud)

如何设置窗口大小以监控大小?

c# wpf window monitor

4
推荐指数
1
解决办法
2万
查看次数

How do you get XAML elements to scale to fit their containers?

I understand that there are a variety of ways to size child elements according to parent elements. If you're using a grid for example, you can use row and column definitions and you get lots of freedom regarding automatic sizes or fixed sizes or "star" sizes. However, if the child elements themselves have a fixed width and height then it won't matter if the parent tells the child to fill all available space. The child element will remain the same …

c# wpf scaling xaml resize

2
推荐指数
1
解决办法
4194
查看次数

标签 统计

wpf ×4

c# ×3

xaml ×2

autosize ×1

monitor ×1

resize ×1

scaling ×1

startmenu ×1

taskbar ×1

window ×1

wpf-controls ×1