Electron.net: Change window size

Created on 13 Apr 2018  路  1Comment  路  Source: ElectronNET/Electron.NET

I searched the forums, but I only found it for ElectronJS. I need to change the size of the window and leave it with a fixed size using Electron.NET

question

Most helpful comment

Hi @GuiFerrari,
do you can set the window size with two ways:

1. On create a new window with BrowserWindowOptions
var browserWindowOptions = new BrowserWindowOptions { Width = 800, Height = 600 }; await Electron.WindowManager.CreateWindowAsync(browserWindowOptions);

2. On runtime with the instance of the BrowserWindow
var browserWindow = Electron.WindowManager.BrowserWindows.First(); browserWindow.SetSize(800, 600);

I hope my answer helps you.

>All comments

Hi @GuiFerrari,
do you can set the window size with two ways:

1. On create a new window with BrowserWindowOptions
var browserWindowOptions = new BrowserWindowOptions { Width = 800, Height = 600 }; await Electron.WindowManager.CreateWindowAsync(browserWindowOptions);

2. On runtime with the instance of the BrowserWindow
var browserWindow = Electron.WindowManager.BrowserWindows.First(); browserWindow.SetSize(800, 600);

I hope my answer helps you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ernestotw85 picture ernestotw85  路  3Comments

litch0 picture litch0  路  4Comments

thnk2wn picture thnk2wn  路  4Comments

BrianAllred picture BrianAllred  路  5Comments

GregorBiswanger picture GregorBiswanger  路  4Comments