moaz786
Solid State Member
- Messages
- 10
- Location
- United States
I was making an OS bootloader right now, and while testing the part that would make it fill the screen up. However, when I use the following code:
I encounter the following error:
An object reference is required for the non-static field, method, or property System.Window.Forms.Form.Size.get
I do not understand the problem, and all related threads are about textbox text, not window size.
Code:
[FONT=Century Gothic][SIZE=3]using System;[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]using System.Collections.Generic;[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]using System.ComponentModel;[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]using System.Data;[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]using System.Drawing;[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]using System.Linq;[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]using System.Text;[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]using System.Windows.Forms;[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]namespace MoazOS_KernelBoot[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]{[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]public partial class krnlboot : Form[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]{[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]public krnlboot()[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]{[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]InitializeComponent();[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]}[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]private void krnlboot_Load(object sender, EventArgs e)[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]{[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]Rectangle resolution = Screen.PrimaryScreen.Bounds;[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]krnlboot.Size = new Size(resolution.Width, resolution.Height);[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]}[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]}[/SIZE][/FONT]
[FONT=Century Gothic][SIZE=3]}[/SIZE][/FONT]
An object reference is required for the non-static field, method, or property System.Window.Forms.Form.Size.get
I do not understand the problem, and all related threads are about textbox text, not window size.