惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Securelist
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
C
CERT Recently Published Vulnerability Notes
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
K
Kaspersky official blog
WordPress大学
WordPress大学
I
Intezer
L
Lohrmann on Cybersecurity
V
Vulnerabilities – Threatpost
C
Check Point Blog
A
About on SuperTechFans
AWS News Blog
AWS News Blog
Latest news
Latest news
宝玉的分享
宝玉的分享
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cyber Attacks, Cyber Crime and Cyber Security
SecWiki News
SecWiki News
Recorded Future
Recorded Future
Last Week in AI
Last Week in AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Register - Security
The Register - Security
A
Arctic Wolf
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
V
V2EX
Scott Helme
Scott Helme
I
InfoQ
Project Zero
Project Zero
Security Archives - TechRepublic
Security Archives - TechRepublic
Recent Announcements
Recent Announcements
Spread Privacy
Spread Privacy
Attack and Defense Labs
Attack and Defense Labs
大猫的无限游戏
大猫的无限游戏
Webroot Blog
Webroot Blog
N
News and Events Feed by Topic
博客园 - 司徒正美
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
NISL@THU
NISL@THU
L
LangChain Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

博客园 - zoop89850

maven 打包 时出现非法字符: /65279错误 JAVA学习笔记 第一篇 开发环境 传输文件过程中遇到异常被中断 项目所需的应用程序未安装,确保已安装项目类型(.csproj)的应用程序的解决办法[转] WPF Image控件中的ImageSource与Bitmap的互相转换 WPF加载相对路径的图片的解决方法 2011/08/27 刷机器,遭遇白苹果,不可连接ipod服务器 的解决 将截图图片放入内存(剪贴板)中 C# 获取屏幕的大小 C# WinForm急速系列 – DataGridView 附Word文档 转载:MicrosoftHelp文件夹中后缀名为.hxw .hxm之类的文件是MSDN帮助文档的索引,不要轻易删除 利用case或者decode实现自定义顺序排序 【摘】枚举类型 一种简单的根据备份文件 恢复数据库的方法 计算sql语句的执行时间 Java,JavaScript,JScript 区别 HTML代码简单教程 文件夹无法打开怎么办? - zoop89850 - 博客园 sqlserver提示“在流水模式下,事务无法启动”的解决办法
窗体的置顶显示
zoop89850 · 2011-11-02 · via 博客园 - zoop89850

前几天碰到了一个问题,

从A窗口双击击某个图片 ,弹出B窗体,按照常理,我们都想看到B窗体的全貌。

但是,让人郁闷的事情发生了,B躲到了A的下面。

1.窗体的属性是

<Window x:Class="WPF.Edit"
   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"  
    Title="PersonalInfoEdit" Height="458" Width="630"   
    WindowStartupLocation="CenterOwner" WindowStyle="None"  AllowsTransparency="True"   Background="{x:Null}"  >

 也没有特异之处,

2.使用Topmost=true 实现的效果又不是我想要的。

终于今天有时间弄它了,在 110行,一个覆盖全窗体的Grid中,MouseLeftButtonDown="Window_MouseLeftButtonDown冒出来了,此功能是想实现不论在哪一个地方拖拽窗体,都能使窗体移动,很好的一个功能。

死也死在这个功能上,因为点击完图片弹出B窗体后,又执行了一遍此功能,将焦点又从B窗体夺了回来。

到这里,问题也就解决了,修改下原画面,将窗体移动功能的鼠标拖拽位置改为最顶和最底两条,就行了。

下面的方法就是拖动窗体的方法。    

   private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ButtonState == MouseButtonState.Pressed )
            {
                this.DragMove();                
            }
        }