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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
V
V2EX
G
Google Developers Blog
F
Full Disclosure
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
H
Hacker News: Front Page
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
NISL@THU
NISL@THU
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
Hacker News - Newest:
Hacker News - Newest: "LLM"
A
About on SuperTechFans
The Cloudflare Blog
C
Cisco Blogs
D
DataBreaches.Net
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Vercel News
Vercel News
P
Privacy International News Feed
Microsoft Security Blog
Microsoft Security Blog
Help Net Security
Help Net Security
Recorded Future
Recorded Future
PCI Perspectives
PCI Perspectives
S
Schneier on Security
AI
AI
N
News | PayPal Newsroom
雷峰网
雷峰网
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
L
LINUX DO - 最新话题
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
Schneier on Security
Schneier on Security
S
Securelist
云风的 BLOG
云风的 BLOG
Stack Overflow Blog
Stack Overflow Blog
博客园_首页
AWS News Blog
AWS News Blog
TaoSecurity Blog
TaoSecurity Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园 - 三生石上(FineUI控件)
C
CXSECURITY Database RSS Feed - CXSecurity.com
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cloudbric
Cloudbric
C
Cybersecurity and Infrastructure Security Agency CISA
Project Zero
Project Zero
C
Check Point Blog
S
Security Affairs

博客园 - 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>