摘要:
private bool HasScrollbar(TextBox TextBox) { bool HasScrollbar = false; List<Grid> list = FindVisualChild<Grid>(TextBox); foreach (var item in list) { 阅读全文
摘要:
private void InsertText(RichTextBox tb, string text) { tb.CaretPosition.InsertTextInRun(text); if (tb.CaretPosition.LogicalDirection == LogicalDirecti 阅读全文
摘要:
前台 <Window x:Class="hittest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/ 阅读全文
摘要:
在richtextbox中添加 <RichTextBox.Resources> <Style TargetType="{x:Type Paragraph}"> <Setter Property="Margin" Value="0"/> </Style> </RichTextBox.Resources 阅读全文
摘要:
Dispatcher.Invoke是同步执行 Dispatcher.Invoke(new Action(() => { stackPanel.Children.Add(new TextBlock() { Text = "1" }); })); stackPanel.Children.Add(new 阅读全文
摘要:
使用cmd命令行录制的可以加入参数-qscale 取值范围是0.01-255,设置的数值越小,则越清晰 下面是我录制时使用的命令行 string command = "ffmpeg -f gdigrab -framerate 20 -video_size 1920*1080 -i desktop - 阅读全文
摘要:
后台代码 WindowsFormsHost host = new WindowsFormsHost(); System.Windows.Forms.PictureBox picture = new System.Windows.Forms.PictureBox(); host.Child = pic 阅读全文
摘要:
效果: 源代码点我下载 阅读全文
摘要:
总是记不住,放上来方便复制 单个参数 [ValueConversion(typeof(int), typeof(string))] public class SexConverter : IValueConverter { public object Convert(object value, Ty 阅读全文
摘要:
private double GetTextWidth(string text) { var textBlock = new System.Windows.Controls.TextBlock { Text = text, TextWrapping = TextWrapping.NoWrap, Fo 阅读全文