【发布时间】:2019-02-28 13:13:05
【问题描述】:
我遇到了一个问题。 我需要我的电子应用程序始终以全角放置在顶部,其他窗口应放置在其下方。 我怎样才能做到这一点? 谁能帮我解决这个问题?
【问题讨论】:
-
希望对您有所帮助C# helper
我遇到了一个问题。 我需要我的电子应用程序始终以全角放置在顶部,其他窗口应放置在其下方。 我怎样才能做到这一点? 谁能帮我解决这个问题?
【问题讨论】:
你应该使用mainWindow.maximize()来显示全屏。
function createWindow() {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 1366,
height: 783,
alwaysOnTop:true //display show on top
})
// and load the index.html of the app.
mainWindow.loadFile('index.html');
// Emitted when the window is closed.
mainWindow.on('closed', function () {
mainWindow = null
})
mainWindow.maximize() //call like this way
}
您可以从here获得更多参考
【讨论】: