rce
Posts: 2
Joined: Fri Apr 12, 2019 3:14 pm

mono winform app and window width

Fri Apr 12, 2019 3:40 pm

Hello,

I recently installed a raspbian to a Rpi3. I also installed an XFCE 4.12 desktop environment and a mono v4.6.2.

I using a screen with resolution 800x480. If I execute "fbset -s" command, the following output appears:

Code: Select all

mode "800x480"
        geometry 800 480 800 480 32
        timings 0 0 0 0 0 0 0
        rgba 8/16,8/8,8/0,8/24
endmode

I filled the form load event in the following way:

Code: Select all

private void Form1_Load(object sender, EventArgs e) {
	TopMost = true;
	FormBorderStyle = FormBorderStyle.None;
	WindowState = FormWindowState.Maximized;
	listBox1.Items.Add("Resolution: " + Screen.PrimaryScreen.Bounds.ToString());
	listBox1.Items.Add("this.Width = " + this.Width + ", height = " + this.Height);
	listBox1.Items.Add("listbox left,top Width*Height = " + listBox1.Left + "," + listBox1.Top + " " + listBox1.Width + "*" + listBox1.Height);
}
When I run it on PC, the following text appears in the listbox:

Code: Select all

Resolution: {X=0,Y=0,Width=1920,Height=1080}
this.Width = 1920, height = 1080
listbox left,top Width*Height = 81,154 331*264
When I run it on raspbian with the "mono App.exe" command this is the message:

Code: Select all

Resolution: {X=0,Y=0,Width=800,Height=480}
this.Width = 933, height = 480
listbox left,top Width*Height = 94,154 385*264
and it can be seen with the naked eye, that the window is scaled accordingly. I mean: every content (buttons, listboxes, labels, etc.) are wider than on Windows10.

My question is: why mono, or XFCE do this horisontal scale? And how could I prevent this?

Tank you in advance,

Gabor

rce
Posts: 2
Joined: Fri Apr 12, 2019 3:14 pm

Re: mono winform app and window width

Wed Apr 17, 2019 7:47 am

Answering my own post... I've found a solution here:

https://stackoverflow.com/questions/236 ... ion-vertic

and here:

https://www.mono-project.com/docs/faq/winforms/

Gabor

Return to “Other programming languages”