diff --git a/WPF控件-12-多文本/App.xaml b/WPF控件-12-多文本/App.xaml new file mode 100644 index 0000000..d272fa2 --- /dev/null +++ b/WPF控件-12-多文本/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/WPF控件-12-多文本/App.xaml.cs b/WPF控件-12-多文本/App.xaml.cs new file mode 100644 index 0000000..ce7df0a --- /dev/null +++ b/WPF控件-12-多文本/App.xaml.cs @@ -0,0 +1,12 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace WPF控件_12_多文本; + +/// +/// Interaction logic for App.xaml +/// +public partial class App : Application +{ +} \ No newline at end of file diff --git a/WPF控件-12-多文本/AssemblyInfo.cs b/WPF控件-12-多文本/AssemblyInfo.cs new file mode 100644 index 0000000..4a05c7d --- /dev/null +++ b/WPF控件-12-多文本/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控件-12-多文本/MainWindow.xaml b/WPF控件-12-多文本/MainWindow.xaml new file mode 100644 index 0000000..e7bbfab --- /dev/null +++ b/WPF控件-12-多文本/MainWindow.xaml @@ -0,0 +1,32 @@ + + + + + + + + + AcceptsReturn="True" (通常情况按下回车会触发默认按钮) AcceptsTab="True" (不会出现焦点现象跳转到下一个控件中) + + + + + + + + \ No newline at end of file diff --git a/WPF控件-12-多文本/MainWindow.xaml.cs b/WPF控件-12-多文本/MainWindow.xaml.cs new file mode 100644 index 0000000..f6c456d --- /dev/null +++ b/WPF控件-12-多文本/MainWindow.xaml.cs @@ -0,0 +1,25 @@ +using System.Windows; +using System.Windows.Input; + +namespace WPF控件_12_多文本; + +/// +/// Interaction logic for MainWindow.xaml +/// +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } + + private void TextBox_OnMouseDoubleClick(object sender, MouseButtonEventArgs e) + { + Console.WriteLine($"有多少行:{TextBox.LineCount}"); + } + + private void TextBox_OnSelectionChanged(object sender, RoutedEventArgs e) + { + Console.WriteLine(TextBox.SelectedText); + } +} \ No newline at end of file diff --git a/WPF控件-12-多文本/WPF控件-12-多文本.csproj b/WPF控件-12-多文本/WPF控件-12-多文本.csproj new file mode 100644 index 0000000..de5c9e2 --- /dev/null +++ b/WPF控件-12-多文本/WPF控件-12-多文本.csproj @@ -0,0 +1,18 @@ + + + + WinExe + net8.0-windows + WPF控件_12_多文本 + enable + enable + true + + + + + Always + + + + diff --git a/WPF控件-12-多文本/public/003540AH4M72.jpg b/WPF控件-12-多文本/public/003540AH4M72.jpg new file mode 100644 index 0000000..4aa96ac Binary files /dev/null and b/WPF控件-12-多文本/public/003540AH4M72.jpg differ diff --git a/WPF控件.sln b/WPF控件.sln index 9ea711d..ee4841b 100644 --- a/WPF控件.sln +++ b/WPF控件.sln @@ -26,6 +26,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-11-Expander", "WP EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-11-Expander2", "WPF控件-11-Expander2\WPF控件-11-Expander2.csproj", "{0D2CEE95-6B52-4D7D-B001-ED6AB4262875}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-12-多文本", "WPF控件-12-多文本\WPF控件-12-多文本.csproj", "{45A695BD-4B02-47F4-8598-144E882A8CF6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -84,5 +86,9 @@ Global {0D2CEE95-6B52-4D7D-B001-ED6AB4262875}.Debug|Any CPU.Build.0 = Debug|Any CPU {0D2CEE95-6B52-4D7D-B001-ED6AB4262875}.Release|Any CPU.ActiveCfg = Release|Any CPU {0D2CEE95-6B52-4D7D-B001-ED6AB4262875}.Release|Any CPU.Build.0 = Release|Any CPU + {45A695BD-4B02-47F4-8598-144E882A8CF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45A695BD-4B02-47F4-8598-144E882A8CF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45A695BD-4B02-47F4-8598-144E882A8CF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45A695BD-4B02-47F4-8598-144E882A8CF6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal