From 47facf0670bf0934f5c5a20ecbade18d6ce42039 Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Thu, 2 Jan 2025 20:54:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20WPF=E6=8E=A7=E4=BB=B6-2-=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E5=85=89=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WPF控件-2-鼠标光标/App.xaml | 9 +++++++++ WPF控件-2-鼠标光标/App.xaml.cs | 12 +++++++++++ WPF控件-2-鼠标光标/AssemblyInfo.cs | 10 ++++++++++ WPF控件-2-鼠标光标/MainWindow.xaml | 12 +++++++++++ WPF控件-2-鼠标光标/MainWindow.xaml.cs | 21 ++++++++++++++++++++ WPF控件-2-鼠标光标/WPF控件-2-鼠标光标.csproj | 12 +++++++++++ WPF控件.sln | 6 ++++++ 7 files changed, 82 insertions(+) create mode 100644 WPF控件-2-鼠标光标/App.xaml create mode 100644 WPF控件-2-鼠标光标/App.xaml.cs create mode 100644 WPF控件-2-鼠标光标/AssemblyInfo.cs create mode 100644 WPF控件-2-鼠标光标/MainWindow.xaml create mode 100644 WPF控件-2-鼠标光标/MainWindow.xaml.cs create mode 100644 WPF控件-2-鼠标光标/WPF控件-2-鼠标光标.csproj diff --git a/WPF控件-2-鼠标光标/App.xaml b/WPF控件-2-鼠标光标/App.xaml new file mode 100644 index 0000000..a1d1744 --- /dev/null +++ b/WPF控件-2-鼠标光标/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/WPF控件-2-鼠标光标/App.xaml.cs b/WPF控件-2-鼠标光标/App.xaml.cs new file mode 100644 index 0000000..aef36b5 --- /dev/null +++ b/WPF控件-2-鼠标光标/App.xaml.cs @@ -0,0 +1,12 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace WPF控件_2_鼠标光标; + +/// +/// Interaction logic for App.xaml +/// +public partial class App : Application +{ +} \ No newline at end of file diff --git a/WPF控件-2-鼠标光标/AssemblyInfo.cs b/WPF控件-2-鼠标光标/AssemblyInfo.cs new file mode 100644 index 0000000..4a05c7d --- /dev/null +++ b/WPF控件-2-鼠标光标/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] \ No newline at end of file diff --git a/WPF控件-2-鼠标光标/MainWindow.xaml b/WPF控件-2-鼠标光标/MainWindow.xaml new file mode 100644 index 0000000..1dec8df --- /dev/null +++ b/WPF控件-2-鼠标光标/MainWindow.xaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/WPF控件-2-鼠标光标/MainWindow.xaml.cs b/WPF控件-2-鼠标光标/MainWindow.xaml.cs new file mode 100644 index 0000000..18e8317 --- /dev/null +++ b/WPF控件-2-鼠标光标/MainWindow.xaml.cs @@ -0,0 +1,21 @@ +using System.Windows; +using System.Windows.Input; + +namespace WPF控件_2_鼠标光标; + +/// +/// Interaction logic for MainWindow.xaml +/// +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + + // 当前光标变为等待图标 + Cursor = Cursors.Wait; + + // 覆盖之前元素上的光标 + Mouse.OverrideCursor = Cursors.Pen; + } +} \ No newline at end of file diff --git a/WPF控件-2-鼠标光标/WPF控件-2-鼠标光标.csproj b/WPF控件-2-鼠标光标/WPF控件-2-鼠标光标.csproj new file mode 100644 index 0000000..942ee04 --- /dev/null +++ b/WPF控件-2-鼠标光标/WPF控件-2-鼠标光标.csproj @@ -0,0 +1,12 @@ + + + + WinExe + net8.0-windows + WPF控件_2_鼠标光标 + enable + enable + true + + + diff --git a/WPF控件.sln b/WPF控件.sln index 1582332..ae13073 100644 --- a/WPF控件.sln +++ b/WPF控件.sln @@ -2,6 +2,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-1-设置颜色", "WPF控件-1-设置颜色\WPF控件-1-设置颜色.csproj", "{5D1AD019-4A90-48E2-815A-35EE2B002BD2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-2-鼠标光标", "WPF控件-2-鼠标光标\WPF控件-2-鼠标光标.csproj", "{C4F2DF6D-2982-419E-8027-CCAD24BC9A4F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -12,5 +14,9 @@ Global {5D1AD019-4A90-48E2-815A-35EE2B002BD2}.Debug|Any CPU.Build.0 = Debug|Any CPU {5D1AD019-4A90-48E2-815A-35EE2B002BD2}.Release|Any CPU.ActiveCfg = Release|Any CPU {5D1AD019-4A90-48E2-815A-35EE2B002BD2}.Release|Any CPU.Build.0 = Release|Any CPU + {C4F2DF6D-2982-419E-8027-CCAD24BC9A4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4F2DF6D-2982-419E-8027-CCAD24BC9A4F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4F2DF6D-2982-419E-8027-CCAD24BC9A4F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C4F2DF6D-2982-419E-8027-CCAD24BC9A4F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal