Show dialog on top of all other windows

2019-07-24 15:27发布

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.

标签: electron
1条回答
SAY GOODBYE
2楼-- · 2019-07-24 15:56

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'
  }
)
查看更多
登录 后发表回答