当前位置: 首页 > news >正文

使用WPF模仿Windows记事本界面

本次仅模仿Windows记事本的模样,并未实现其功能。

所有代码如下:

<Window x:Class="控件的基础使用.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:控件的基础使用"
        mc:Ignorable="d"
        Title="记事本" Height="700" Width="800">
    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="600"/>
                <RowDefinition Height="20"/>
            </Grid.RowDefinitions>
            <Menu Background="White" Grid.Row="0">
                <MenuItem Header="文件">
                    <MenuItem Header="新建标签页"/>
                    <MenuItem Header="新建窗口"/>
                    <MenuItem Header="打开"/>
                    <MenuItem Header="保存"/>
                    <MenuItem Header="另存为"/>
                    <MenuItem Header="全部保存"/>
                    <MenuItem Header="页面设置"/>
                    <MenuItem Header="打印"/>
                    <MenuItem Header="关闭选项卡"/>
                    <MenuItem Header="关闭窗口"/>
                    <MenuItem Header="退出"/>
                </MenuItem>
                <MenuItem Header="编辑">
                    <MenuItem Header="撤销"/>
                    <MenuItem Header="剪切"/>
                    <MenuItem Header="复制"/>
                    <MenuItem Header="粘贴"/>
                    <MenuItem Header="删除"/>
                    <MenuItem Header="查找"/>
                    <MenuItem Header="查找下一个"/>
                    <MenuItem Header="查找上一个"/>
                    <MenuItem Header="替换"/>
                    <MenuItem Header="转到"/>
                    <MenuItem Header="全选"/>
                    <MenuItem Header="时间/日期"/>
                    <MenuItem Header="字体"/>
                </MenuItem>
                <MenuItem Header="查看">
                    <MenuItem Header="缩放">
                        <MenuItem Header="放大"/>
                        <MenuItem Header="缩小"/>
                        <MenuItem Header="还原默认缩放"/>
                    </MenuItem>
                    <MenuItem Header="状态栏"/>
                    <MenuItem Header="自动换行"/>
                </MenuItem>
            </Menu>
            <RichTextBox Grid.Row="1"  VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible"/>
            <StackPanel Grid.Row="2" Orientation="Horizontal" Background="White">
                <TextBlock Text="行,列" Margin="50,0,0,0"/>
                <TextBlock Text="100%" Margin="50,0,0,0"/>
                <TextBlock Text="windows(CRLF)" Margin="50,0,0,0"/>
                <TextBlock Text="UTF-8" Margin="50,0,0,0"/>
            </StackPanel>
        </Grid>
    </Grid>
</Window>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace 控件的基础使用
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    }
}

菜单:


文章转载自:
http://banting.wsgyq.cn
http://acta.wsgyq.cn
http://auriferous.wsgyq.cn
http://berkeleian.wsgyq.cn
http://blanketry.wsgyq.cn
http://calorimetrist.wsgyq.cn
http://brown.wsgyq.cn
http://bannerline.wsgyq.cn
http://blamelessly.wsgyq.cn
http://avowal.wsgyq.cn
http://adrenocorticosteroid.wsgyq.cn
http://chinchin.wsgyq.cn
http://buckinghamshire.wsgyq.cn
http://amy.wsgyq.cn
http://canalled.wsgyq.cn
http://asyndeton.wsgyq.cn
http://caritative.wsgyq.cn
http://aftertreatment.wsgyq.cn
http://broad.wsgyq.cn
http://campbellism.wsgyq.cn
http://articulation.wsgyq.cn
http://ceiling.wsgyq.cn
http://choose.wsgyq.cn
http://bab.wsgyq.cn
http://antialien.wsgyq.cn
http://bullpout.wsgyq.cn
http://anthroponym.wsgyq.cn
http://budless.wsgyq.cn
http://autorotation.wsgyq.cn
http://candlelight.wsgyq.cn
http://www.dtcms.com/a/2932.html

相关文章:

  • 【单片机学习笔记】Windows+Vscode+STM32F4+freeRTOS+FatFs gcc环境搭建
  • 大学英语试卷
  • 数组的初始化以及拷贝
  • 使用GoogleNet网络实现花朵分类
  • 在Kubernetes(k8s)上部署整个SpringCloud微服务应用
  • Java IO流
  • 从零开始搭建第一个django项目
  • 使用序列化技术保存数据 改进 IO流完成项目实战水果库存系统
  • Kotlin中的内联函数:提升性能与解决Lambda表达式参数问题
  • 模拟器-雷电-使用adb push或adb pull操作文件
  • Android Studio初学者实例:RecyclerView学习--模仿今日头条--续
  • 向量检索库Milvus架构及数据处理流程
  • 如何系统 如何进行SQL监控-执行SQL分析打印
  • 【每日一练】20231023
  • 紫光同创FPGA实现PCIE测速试验,提供PDS工程和Linux QT上位机源码和技术支持
  • 报错:The supplied javaHome seems to be invalid. I cannot find the java executable
  • 如何开发一个 Safari 插件
  • flutter开发的一个小小小问题,内网依赖下不来
  • RemObjects Elements 12.0 Crack
  • 【safetensor】Debug
  • 智慧河湖方案:AI赋能水利水务,构建河湖智能可视化监管大数据平台
  • 【Gensim概念】03/3 NLP玩转 word2vec
  • pdf导出实例(itestpdf)
  • android项目实践说明
  • 8.3 C++ 定义并使用类
  • 解决Kafka新消费者组导致重复消费的问题
  • Jmeter(九):jmeter_逻辑控制器与HTTP Cookie管理器详解
  • Node.js的crypto模块 加密
  • Kafka三种认证模式,Kafka 安全认证及权限控制详细配置与搭建
  • notes_NLP