Change window size #144

Closed
opened 2026-01-29 16:32:22 +00:00 by claunia · 2 comments
Owner

Originally created by @GuiFerrari on GitHub (Apr 13, 2018).

Originally assigned to: @GregorBiswanger on GitHub.

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

Originally created by @GuiFerrari on GitHub (Apr 13, 2018). Originally assigned to: @GregorBiswanger on GitHub. 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
claunia added the question label 2026-01-29 16:32:22 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (Apr 14, 2018):

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.

@GregorBiswanger commented on GitHub (Apr 14, 2018): 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.
Author
Owner

@krishrana17 commented on GitHub (Jan 4, 2023):

Is there any way to get the screen width and height in Electron.Net ?
I don't want to specify any static value like this -
var browserWindowOptions = new BrowserWindowOptions { Width = 800, Height = 600 }; await Electron.WindowManager.CreateWindowAsync(browserWindowOptions);

@krishrana17 commented on GitHub (Jan 4, 2023): Is there any way to get the screen width and height in Electron.Net ? I don't want to specify any static value like this - `var browserWindowOptions = new BrowserWindowOptions { Width = 800, Height = 600 }; await Electron.WindowManager.CreateWindowAsync(browserWindowOptions);`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#144