在所有其他窗口上方显示对话框 [英] Show dialog on top of all other windows
本文介绍了在所有其他窗口上方显示对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法可以显示来自dialog.showMessageBox()的所有内容?
Is there a way to show the dialog from dialog.showMessageBox() on top of everything?
例如,我在记事本上醒来并给出了一些提示事件在我的Electron应用程序中将打开一个对话框,该对话框现在应该是用户看到的主窗口。
For example, I'm woking on the notepad and given some event in my Electron application it will open a dialog that should now be the main window for the user to see.
推荐答案
有点丑陋,但您可以通过始终位于顶部的虚拟持有人浏览器窗口。
It's kinda ugly but you can pass a dummy holder browserwindow which is always on top.
dialog.showMessageBox(
new BrowserWindow({
show: false,
alwaysOnTop: true
}),
{
type: 'question',
message: 'is on top'
}
)
这篇关于在所有其他窗口上方显示对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文