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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
S
SegmentFault 最新的问题
Project Zero
Project Zero
D
DataBreaches.Net
I
InfoQ
L
Lohrmann on Cybersecurity
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
The Register - Security
The Register - Security
Recorded Future
Recorded Future
Vercel News
Vercel News
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
Intezer
The Hacker News
The Hacker News
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
Help Net Security
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Scott Helme
Scott Helme
T
Threatpost
爱范儿
爱范儿
N
Netflix TechBlog - Medium
D
Docker
云风的 BLOG
云风的 BLOG
C
Cisco Blogs
K
Kaspersky official blog
H
Help Net Security
S
Secure Thoughts
T
Threat Research - Cisco Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Security @ Cisco Blogs
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
G
Google Developers Blog
Forbes - Security
Forbes - Security
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
B
Blog
Google DeepMind News
Google DeepMind News
Recent Announcements
Recent Announcements
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
P
Privacy International News Feed
Spread Privacy
Spread Privacy
The Last Watchdog
The Last Watchdog

博客园 - Jiger

TypeScript 编译目标(target)设置 微软下一代Web前端技术Blazor(C#编译为WebAssembly) LinqPad的变量比较功能 Web后台技术趋势 MSBI - KPI 数据库的NULL值讨论 所有的列表都应该考虑排序 产品应该努力提高用户使用的方便性 上传和下载控制协议 CSV文件的规范 Silverlight商业应用实例-新浪财经银光版 前台线程和后台线程的区别 xaml数据绑定时字段不存在的错误处理方法 jQuery中bind函数绑定多个事件 StringFormat绑定语法中的问题 wpf/silverlight指定空值特殊显示的语法 jQuery的ajax函数中timeout参数的默认值 Visual Studio中Website和Web Application Project的区别 Silverlight 2.0 学习笔记王计平版-01-开始学习XAML
笔记:如何让wpf中disabled的控件弹出右键菜单 - Jiger - 博客园
Jiger · 2010-06-17 · via 博客园 - Jiger

wpf/silverlight中,如果一个控件定义有邮件菜单,而当控件的disabled=true时,默认情况下,系统禁止弹出右键菜单,这时可以使用如下方法弹出,

<Window x:Class="HDI_WPF_ContextMenu_cs.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
    <Grid>
        <TextBox x:Name="txtInput"
            IsEnabled="False"
            ContextMenuService.ShowOnDisabled="True"
            Height="23" Width="200" Background="LightBlue" VerticalAlignment="Top" Margin="50">
            <TextBox.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Menu Item 1" Click="MenuItem_Click" />
                    <MenuItem Header="Menu Item 2" IsCheckable="True" IsChecked="True" />
                    <MenuItem Header="Menu Item 3" Click="MenuItem_Click_1"/>
                </ContextMenu>
            </TextBox.ContextMenu>
        </TextBox>
    </Grid>
</Window>