16
2023
03

演播室提示字幕1.3

主要用在两个屏幕的提示器,比如演播室。

一个操作屏(使用软件区),一个是显示屏(黑色部分)。
在软件上点某行,这行就显示到显示屏上。
按F12上屏或编辑文字。


13
2022
05

wpf中建立菜单快捷键

xaml文件

<Window.Resources>

        <RoutedUICommand x:Key="F3" Text="查找内容"/>

        <RoutedUICommand x:Key="Search" Text="查找内容"/>

29
2021
10

(转)WPF 进度条ProgressBar

转:幻影星辰 

1.传统ProgressBar

WPF进度条ProgressBar 这个控件,如果直接写到循环里,会死掉,界面会卡死,不会有进度。需要把进度条放到单独的线程中。

22
2021
10

WPF的listview总是滚动到最后一行

需求:显示最后加入的项,即listView最后的一项

listView1.SelectedIndex = listView1.Items.Count-1;

listView1.ScrollIntoView(listView1.SelectedItem);

24
2021
09

《我的记事本》编程过程(4)

下面的示例演示如何设置元素的 FontStyle 属性 TextBlock 。

<TextBlock Name="textBlock" Background="AntiqueWhite" Foreground="Navy"   
    FontFamily="Century Gothic" //字体
    FontSize="12"               //字号
    FontStretch="UltraExpanded"
    FontStyle="Italic"          //倾斜
    FontWeight="UltraBold"      //粗体
    TextDecorations=”Underline” //下划线

    LineHeight="Auto"
    Padding="5,10,5,10"
    TextAlignment="Center"      //居中
    TextWrapping="Wrap"     //自动换行

    Typography.NumeralStyle="OldStyle"
    Typography.SlashedZero="True"
    >
    <Run Background="LightGreen">Text run 1.</Run>
    <LineBreak/><Run Background="LightBlue">Text run 2.</Run>
    <LineBreak/><Run Background="LightYellow">Text run 3.</Run>
</TextBlock>

读取系统字体列表:参考

23
2021
09

《我的记事本》编程过程(3)

绑定数据、数据自定义转换


自定义事件转:Binding值转换器ValueConverter使用

public class WrapConver : IValueConverter

设定为资源

23
2021
09

《我的记事本》编程过程(2)

导入窗体图标文件:

Icon="pack://siteoforigin:,,,/Resources/file_document.tif"


菜单导入图标:

<MenuItem.Icon>

    <Image Source="pack://siteoforigin:,,,/Resources/folder_open.tif" Height="20" />

</MenuItem.Icon>


菜单分隔:

 <Separator />

23
2021
09

《我的记事本》编程过程(1)

建立新项目

搭建基本框架:

窗体、菜单、编辑区、工具条

«1»