如何使用C#,使形式系统模式? [英] How to make form system modal using C#?

查看:131
本文介绍了如何使用C#,使形式系统模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要展示的形式为顶级的全系统,如:在/在屏幕上的所有/其它窗口。我不知道这通常是/坏UI实践/,但我有非常特殊的情况下考虑。

I need to show form as top level system-wide, e.g. over /all/ other windows on screen. I do realize this is usually /bad UI practice/, but I have very specific scenario in mind.

我们打算用普通的Windows PC的POS收款机registrators。我看不到屏幕上的选项,打开钱箱。这将是很坏的人只是在屏幕上preSS的东西和获取金钱,当店员不看。所以我们配备的PC与RFID阅读器和每个店员具有将用于认证他/她自己的RFID卡。

We intend to use normal Windows PCs for POS cash registrators. There is an option on the screen to open cash drawer. It would be rather bad for someone just to press something on a screen and get access to money when clerk isn't looking. So we equiped PCs with RFID readers and each clerk has his/her own RFID card which will be used for authentication.

我需要的不过机制来锁定计算机(或使其无法使用)时,店员消失。注销似乎太讨厌了。

I need however an mechanism to lock the computer (or make it unusable) when clerk goes away. Logging off seems too much of a nuisance.

任何想法表示欢迎。

LP, 德扬

推荐答案

嗯,反复试验的前一天,我来到排序的解决方案。

Well, after a day of trial and error I came to sort of solution.

有包括以下步骤:

1。 当锁定按钮是pressed新(空)/桌面/创建。 程序运行在该桌面全屏的形式和登录程序。 没有别的切换到或者运行桌面上。

1. When "Lock" button is pressed new (empty) /desktop/ is created. Program is run in this desktop with full screen form and login procedure. There is nothing else to switch to or run on this desktop.

2。 任务管理器是通过注册表禁用。 当然,有人不请自来仍然可以访问CTRL-ALT-删除菜单,但并没有什么特别的伤害,他可以在那里做。

2. Task manager is disabled via registry. Of course, somebody uninvited can still access the Ctrl-Alt-Delete menu, but there is nothing of particular harm he can do there.

3。 ALT-F4和如禁用。

3. Alt-F4 and such are disabled.

4。 当进行认证,程序切换回原来的桌面,一切正常进行。

4. When authentication is made, program switches back to original desktop and everything proceeds as normal.

有一些P /援引必修课。 如果有人想要做类似的事情,也许他/她会发现我裸露的骨头例如有帮助 -

There is some P/Invoking required, of course. If someone wants to do something similar, perhaps s/he will find my bare bones example helpful - link text

LP, 德扬

这篇关于如何使用C#,使形式系统模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆