Show dialog on top of all other windows

 ̄綄美尐妖づ 提交于 2019-12-11 06:29:49

问题


Is there a way to show the dialog from dialog.showMessageBox() on top of everything?

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.


回答1:


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'
  }
)


来源:https://stackoverflow.com/questions/46608622/show-dialog-on-top-of-all-other-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!