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

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - 克仔

克仔嘅第一次。。。“浮潜” Exact ADC之Paintball大戦 - 克仔 - 博客园 .NET Compact Framework里的DateTimePicker Control显示錯误的month selection list .NET CF里的toolbar image在Windows Mobile 2003 SE消失了。 先嚟為《達文西的密碼》電影熱熱身。 汽油起價 - 加油站車龍。 我嘅第一部O2 Xda ll mini 《達文西的密碼》登上大银幕 Single Instance Appplication in .NET CF 丹•布朗 《數字城堡》 全新ARM base PocketPC 2003 Emulator Beta 已登場。 向左走,向右走? 全新旅途。。。 如何在ASP.NET里用HtmlInputFile控件来上载文件。 達文西的密碼 - 後記。 達文西的密碼。 如何用ASP.NET里的State Management Database来储存Session Variable。 如何用DataSet.GetChanges来提升数据库资料更新效率。 如何用SqlConnection类的InfoMessage事件来显示Stored Procedure的PRINT讯息。 Deamon Tool
.NET CF v1的Form.ShowDialog(Me)里的Me在不能用了!
克仔 · 2005-07-08 · via 博客园 - 克仔

(華)

又碰釘子了~ 一般要创建一个model dialog,我门都会用Form.ShowDialog();但。。。问题就是此ShowDialog()只会创建一个没有Owner的model dialog,所以新创建的model dialog是和main程序拥有相同的parent window。。。就是desktop window了。这样就会造成用户能够同过Running Program里activate main程序的windows去top level window,这样。。。ShowDialog()就不能再达到如.NET Framework里的ShowDialog(Me)的效果。

此问题已在.NET CF v2里解决了,但在期待.NET CF v2的面世之余。。。以下就是两个不同的解决方案,不防讨论下。

方案一:

'把Form1的Text从Running Program里删除掉
Me.Text = ""

Dim frm As New Form2
'把mdel dialog的Text换去跟Form1.Text一样(不如说Demo)所以能够出现在Running Program List里
frm.Text = "Demo"
'创建model dialog
frm.ShowDialog()
'还原Form1的Text,所以可以出先在Running Program里
Me.Text = "Demo"

'确定Form1就是下一个visible top level window
Me.Capture = True
'此是两个Win32API,详细请游览http://www.pinvokenet
SetForegroundWindow(GetCapture())
Me.Capture = False


方案二:

'把Form1 hide起来
Me.Hide()

Dim frm As New Form2
'创建model dialog
frm.ShowDialog()

'把Form1 show出来
Me.Show()


posted on 2005-07-08 08:45  克仔  阅读(1669)  评论(2)    收藏  举报