Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何更改TabItem的光标_C#_.net_Wpf_Xaml - Fatal编程技术网

C# 如何更改TabItem的光标

C# 如何更改TabItem的光标,c#,.net,wpf,xaml,C#,.net,Wpf,Xaml,我试图更改TabItem光标,但它仅在鼠标悬停在按钮上时才会更改。控制区域的其余部分仍显示“箭头”光标。如何解决这个问题 <Window x:Class="WpfApplication4.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

我试图更改TabItem光标,但它仅在鼠标悬停在按钮上时才会更改。控制区域的其余部分仍显示“箭头”光标。如何解决这个问题

<Window x:Class="WpfApplication4.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <TabControl>
        <TabItem Header="Tab" Cursor="Wait">
            <Button Content="qwe" Height="25" />
        </TabItem>
    </TabControl>
</Window>

你可以把你的
按钮
放在一个可以伸展的地方,以填满整个可用空间

<TabControl>
    <TabItem Header="Tab" Cursor="Wait">
        <Grid Background="Transparent">
            <Button Content="qwe" Height="25" />
        </Grid>
    </TabItem>
</TabControl>

在本例中类似于
网格
,但请注意,您需要将
背景
指定给类似于
透明
的对象,否则它将不可见