创新的南昌网站建设/长沙今日头条新闻

创新的南昌网站建设,长沙今日头条新闻,网站快排是怎么做的,北京市建设网站常规的无边框方法设计 常规的WPF无边框设计方法都是通过AllowsTransparency="True"和WindowStyle=“None”,并且使用WindowChrome样式来实现,但是这样会有问题就是,窗体最大化的时候将底部任务栏给挡住了,另外最大化的时候不能拖动窗体。参考这个大佬的设计@ 若…

常规的无边框方法设计

常规的WPF无边框设计方法都是通过AllowsTransparency="True"和WindowStyle=“None”,并且使用WindowChrome样式来实现,但是这样会有问题就是,窗体最大化的时候将底部任务栏给挡住了,另外最大化的时候不能拖动窗体。参考这个大佬的设计@ 若汝棋茗 WPF制作无边框窗体、圆角窗体、支持改变大小、拖动分屏等(一)
但是感觉好麻烦啊。

比较完美的无边框设计

参照这个大佬的设计:梦机器工作室。保留了原改生的最小化、最大化、关闭、拖拽、伸缩窗体大小等操作。
在这里插入图片描述
可以看到在设计器内还是保留了默认的WindowStyle。

运行效果

在这里插入图片描述
完整的源码。

资源字典

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApp1"><Style x:Key="BorderlessButton" TargetType="Button"><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="Button"><Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Background="{TemplateBinding Background}"><Border x:Name="bg" Background="{StaticResource TransparentColor}" /><Path x:Name="content"Width="{TemplateBinding local:Icon.Width}"Height="{TemplateBinding local:Icon.Height}"Data="{TemplateBinding local:Icon.Geometry}"Fill="{TemplateBinding Foreground}"Stretch="Fill"UseLayoutRounding="True" /></Grid><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter TargetName="bg" Property="Background" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(local:Mouse.OverBackColor)}" /></Trigger><Trigger Property="IsPressed" Value="True"><Setter Property="Opacity" Value="0.8" /></Trigger></ControlTemplate.Triggers></ControlTemplate></Setter.Value></Setter></Style><!--#region 系统窗口--><Style x:Key="BorderlessWindowStyle" TargetType="{x:Type local:BorderlessWindow}"><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="{x:Type local:BorderlessWindow}"><Border Background="{TemplateBinding Background}"BorderBrush="{TemplateBinding BorderBrush}"BorderThickness="{TemplateBinding BorderThickness}"SnapsToDevicePixels="True"><Grid Margin="{TemplateBinding Padding}"><Grid.RowDefinitions><RowDefinition Height="Auto" /><RowDefinition /></Grid.RowDefinitions><AdornerDecorator x:Name="content" Grid.Row="1"><ContentPresenter /></AdornerDecorator><ResizeGrip x:Name="ResizeGrip"Grid.Row="1"Margin="0,0,5,5"HorizontalAlignment="Right"VerticalAlignment="Bottom"IsTabStop="False"Visibility="Collapsed"WindowChrome.ResizeGripDirection="BottomRight" /><Grid Background="{TemplateBinding CaptionBackground}"><Grid.ColumnDefinitions><ColumnDefinition /><ColumnDefinition Width="Auto" /></Grid.ColumnDefinitions><ContentPresenter Content="{TemplateBinding TitleContent}" /><StackPanel Grid.Column="1" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True"><!--  最小化按钮  --><Button x:Name="ButtonMin"Width="{TemplateBinding SystemButtonSize}"Height="{TemplateBinding SystemButtonSize}"local:Icon.Geometry="F1M0,6L0,9 9,9 9,6 0,6z"local:Icon.Height="3"local:Mouse.OverBackColor="{TemplateBinding SystemButtonOverColor}"Background="{TemplateBinding SystemButtonColor}"Command="SystemCommands.MinimizeWindowCommand"Foreground="{TemplateBinding SystemButtonForeground}"IsTabStop="False"Style="{StaticResource BorderlessButton}" /><!--  最大化按钮  --><Button x:Name="ButtonMax"Width="{TemplateBinding SystemButtonSize}"Height="{TemplateBinding SystemButtonSize}"local:Icon.Geometry="F1M0,0L0,9 9,9 9,0 0,0 0,3 8,3 8,8 1,8 1,3z"local:Mouse.OverBackColor="{TemplateBinding SystemButtonOverColor}"Background="{TemplateBinding SystemButtonColor}"Command="SystemCommands.MaximizeWindowCommand"Foreground="{TemplateBinding SystemButtonForeground}"IsTabStop="False"Style="{StaticResource BorderlessButton}" /><!--  恢复按钮  --><Button x:Name="ButtonRestore"Width="{TemplateBinding SystemButtonSize}"Height="{TemplateBinding SystemButtonSize}"local:Icon.Geometry="F1M0,10L0,3 3,3 3,0 10,0 10,2 4,2 4,3 7,3 7,6 6,6 6,5 1,5 1,10z M1,10L7,10 7,7 10,7 10,2 9,2 9,6 6,6 6,9 1,9z"local:Mouse.OverBackColor="{TemplateBinding SystemButtonOverColor}"Background="{TemplateBinding SystemButtonColor}"Command="SystemCommands.RestoreWindowCommand"Foreground="{TemplateBinding SystemButtonForeground}"IsTabStop="False"Style="{StaticResource BorderlessButton}" /><!--  关闭窗口按钮  --><Button x:Name="ButtonClose"Width="{TemplateBinding SystemButtonSize}"Height="{TemplateBinding SystemButtonSize}"local:Icon.Geometry="M453.44 512L161.472 220.032a41.408 41.408 0 0 1 58.56-58.56L512 453.44 803.968 161.472a41.408 41.408 0 0 1 58.56 58.56L570.56 512l291.968 291.968a41.408 41.408 0 0 1-58.56 58.56L512 570.56 220.032 862.528a41.408 41.408 0 0 1-58.56-58.56L453.44 512z"local:Mouse.OverBackColor="{TemplateBinding SystemButtonCloseOverColor}"Background="{TemplateBinding SystemButtonColor}"Command="SystemCommands.CloseWindowCommand"Foreground="{TemplateBinding SystemButtonForeground}"IsTabStop="False"Style="{StaticResource BorderlessButton}" /></StackPanel></Grid></Grid></Border><ControlTemplate.Triggers><Trigger Property="FitSystemWindow" Value="True"><Setter TargetName="content" Property="Grid.Row" Value="0" /><Setter TargetName="content" Property="Grid.RowSpan" Value="2" /></Trigger><Trigger Property="WindowState" Value="Maximized"><Setter Property="Padding" Value="8" /><Setter TargetName="ButtonMax" Property="Visibility" Value="Collapsed" /><Setter TargetName="ButtonRestore" Property="Visibility" Value="Visible" /></Trigger><Trigger Property="WindowState" Value="Normal"><Setter TargetName="ButtonMax" Property="Visibility" Value="Visible" /><Setter TargetName="ButtonRestore" Property="Visibility" Value="Collapsed" /></Trigger><Trigger Property="ResizeMode" Value="NoResize"><Setter TargetName="ButtonMin" Property="Visibility" Value="Collapsed" /><Setter TargetName="ButtonMax" Property="Visibility" Value="Collapsed" /><Setter TargetName="ButtonRestore" Property="Visibility" Value="Collapsed" /></Trigger><Trigger Property="ResizeMode" Value="CanMinimize"><Setter TargetName="ButtonMax" Property="Visibility" Value=

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/897870.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C语言【数据结构】:时间复杂度和空间复杂度.详解

引言 详细介绍什么是时间复杂度和空间复杂度。 前言&#xff1a;为什么要学习时间复杂度和空间复杂度 算法在编写成可执行程序后&#xff0c;运行时需要耗费时间资源和空间(内存)资源。因此衡量一个算法的好坏&#xff0c;一般是从时间和空间两个维度来衡量的&#xff0c;即时…

32单片机——LED

LED原理图如图所示&#xff1a; 代码 DS0和DS1每过500ms一次交替闪烁&#xff0c;实现类似跑马灯的效果 GPIO输出配置步骤 &#xff08;1&#xff09;使能对应GPIO时钟 STM32在使用任何外设之前&#xff0c;我们都要先使能其时钟&#xff08;下同&#xff09;。本实验用到…

贪心算法和遗传算法优劣对比——c#

项目背景&#xff1a;某钢管厂的钢筋原材料为 55米&#xff0c;工作需要需切割 40 米&#xff08;1段&#xff09;、11 米&#xff08;15 段&#xff09;等 4 种规格 &#xff0c;现用贪心算法和遗传算法两种算法进行计算&#xff1a; 第一局&#xff1a;{ 40, 1 }, { 11, 15…

【Java篇】一法不变,万象归一:方法封装与递归的思想之道

文章目录 Java 方法的使用&#xff1a;从基础到递归的全面解析一、方法的概念及使用1.1 什么是方法 (method)?1.2 方法定义1.3 方法调用的执行过程1.4 实参和形参的关系1.5 没有返回值的方法 二、方法重载2.1 为什么需要方法重载2.2 方法重载的概念2.2.4 C 和 Java 的比较&…

实验5 逻辑回归

实验5 逻辑回归 【实验目的】掌握逻辑回归算法 【实验内容】处理样本&#xff0c;使用逻辑回归算法进行参数估计&#xff0c;并画出分类边界 【实验要求】写明实验步骤&#xff0c;必要时补充截图 1、参照“2.1梯度下降法实现线性逻辑回归.ipynb”和“2.2 sklearn实现线性逻辑…

思维训练让你更高、更强 |【逻辑思维能力】「刷题训练笔记」假设法模式逻辑训练题(1-5)

每日一刷 思维训练让你更高、更强&#xff01; 题目1 谁在说谎&#xff0c;谁拿走了零钱&#xff1f; 姐姐上街买菜回来后&#xff0c;就随手把手里的一些零钱放在了抽屉里&#xff0c;可是&#xff0c;等姐姐下午再去拿钱买菜的时候发现抽屉里的零钱没有了&#xff0c;于是&…

用python代码将excel中的数据批量写入Json中的某个字段,生成新的Json文件

需求 需求&#xff1a; 1.将execl文件中的A列赋值给json中的TrackId&#xff0c;B列赋值给json中的OId 要求 execl的每一行&#xff0c;对应json中的每一个OId json 如下&#xff1a; {"List": [{"BatchNumber": "181-{{var}}",// "Bat…

【Python】dash-fastapi前后端搭建

概述 项目中需要快速搭建一个前后端系统&#xff0c;涉及到dash-fastapi架构的时候&#xff0c;对该架构的时候进行总结。本文主要总结的是对该架构的基本使用&#xff0c;后续再对该架构的项目源码进行总结分析 此处实现一个小的demo&#xff0c;迷你任务管理器&#xff0c;…

IDEA中链接使用mysql数据库

一、连接mysql 1. 打开idea&#xff0c;在右上角侧边栏有数据库database插件&#xff0c;打开侧边栏点击加号->数据源&#xff0c;可以看到支持很多数据库&#xff0c;选择mysql。 2. 首次使用需要下载驱动程序&#xff0c;不然连接数据库会报错。找到mysql&#xff0c;点击…

程序编译生成的文件

目录 .i 文件 .s 文件 .o文件 总结 在 C 编程中&#xff0c;.i、.s和 .o 文件是编译过程中生成的不同阶段的文件&#xff0c;它们代表不同的含义&#xff1a; .i 文件 全称 &#xff1a;预处理后的文件&#xff08;Intermediate File&#xff09;。 含义&#xff1a;.i文件…

[S32K]SPI

SpiShiftClockidleLevel: CLK空闲时电平(CPOL)&#xff1b; SpiDataShifrEdge:数据移位边沿(CPHA)&#xff1b; SpiDataWidth: SpiTransferStart: MSB(高位起始)&#xff0c;LSB(低位起始)&#xff1b;&#xff1b; SpiHwUnit: 这是一个具体的硬件&#xff1f; SpiDataShiftE…

系统思考:客户价值

“真正的市场竞争&#xff0c;不是比谁更能制造产品&#xff0c;而是比谁更能创造价值。” ——杰夫贝索斯 在组织辅导中&#xff0c;我经常问团队一个问题&#xff1a;“我们的客户是谁&#xff1f;”大多数人的第一反应是——“支付费用的就是客户。” 这在过去的市场扩张阶…

ArcGIS Pro 车牌分区数据处理与地图制作全攻略

在大数据时代&#xff0c;地理信息系统&#xff08;GIS&#xff09;技术在各个领域都有着广泛的应用&#xff0c;而 ArcGIS Pro 作为一款功能强大的 GIS 软件&#xff0c;为数据处理和地图制作提供了丰富的工具和便捷的操作流程。 车牌数据作为一种重要的地理空间数据&#xf…

OpenCV图像加权函数:addWeighted

1 addWeighted函数 在OpenCV 里&#xff0c;addWeighted 函数的作用是对两个图像进行加权求和&#xff0c;常用于图像融合、图像过渡等场景。函数如下&#xff1a; cv2.addWeighted(src1, alpha, src2, beta, gamma[, dst[, dtype]])2 参数解释 src1&#xff1a;第一个输入图…

Tcp网络通信的基本流程梳理

先来一张经典的流程图 接下介绍一下大概流程&#xff0c;各个函数的参数大家自己去了解加深一下印象 服务端流程 1.创建套接字&#xff1a;使用 socket 函数创建一个套接字&#xff0c;这个套接字后续会被用于监听客户端的连接请求。 需要注意的是&#xff0c;服务端一般有俩…

leecode797.所有可能的路径

深度优先搜索 class Solution { private:vector<vector<int>> result;vector<int> temp;void allPathsSourceTarget(vector<vector<int>> &graph,int v){if(vgraph.size()-1)result.push_back(temp);else{for(auto& adjVertex:graph[v]…

第八节:红黑树(初阶)

【本节要点】 红黑树概念红黑树性质红黑树结点定义红黑树结构红黑树插入操作的分析 一、红黑树的概念与性质 1.1 红黑树的概念 红黑树 &#xff0c;是一种 二叉搜索树 &#xff0c;但 在每个结点上增加一个存储位表示结点的颜色&#xff0c;可以是 Red和 Black 。 通过对 任何…

微信小程序threejs三维开发

微信小程序threejs开发 import * as THREE from three; const { performance, document, window, HTMLCanvasElement, requestAnimationFrame, cancelAnimationFrame, core, Event, Event0 } THREE .DHTML import Stats from three/examples/jsm/libs/stats.module.js; im…

jupyter无法转换为PDF,HTMLnbconvert failed: Pandoc wasn‘t found.

无法转为PDF 手动下载工具 https://github.com/jgm/pandoc/releases/tag/3.6.3 似乎跟我想的不大一样&#xff0c;还有新的报错 https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex 不知道下的啥玩意儿 sudo apt-get install texlive-xetex texlive-fon…

使用 Excel 实现绩效看板的自动化

引言 在日常工作中&#xff0c;团队的绩效监控和管理是确保项目顺利进行的重要环节。然而&#xff0c;面临着以下问题&#xff1a; ​数据分散&#xff1a;系统中的数据难以汇总&#xff0c;缺乏一个宏观的团队执行情况视图。​看板缺失&#xff1a;系统本身可能无法提供合适…