Squatcher
Member
- Joined
- Mar 1, 2023
- Messages
- 5
- Programming Experience
- Beginner
Good morning,
I write code for my own use, so I am not a day to day coder and I have spans of time that I dont even touch Visual Studio.
But, I am getting an error that I am having difficulty figuring out why.
I started a new project, there is only one Form and in that form it has a Label that I am attempting to attach information from the Properties.Settings and got the error of CS0120. I am sure at one time I figured it out, but having issues today.
Thank you
I write code for my own use, so I am not a day to day coder and I have spans of time that I dont even touch Visual Studio.
But, I am getting an error that I am having difficulty figuring out why.
I started a new project, there is only one Form and in that form it has a Label that I am attempting to attach information from the Properties.Settings and got the error of CS0120. I am sure at one time I figured it out, but having issues today.
Main:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ham_Radio.Properties;
namespace Ham_Radio
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
// Script to size Form to half monitors size.
StartPosition = FormStartPosition.Manual;
Rectangle screen = Screen.FromPoint(Cursor.Position).WorkingArea;
int w = Width >= screen.Width ? screen.Width : (screen.Width + Width) / 2;
int h = Height >= screen.Height ? screen.Height : (screen.Height + Height) / 2;
Location = new Point(screen.Left + (screen.Width - w) / 2, screen.Top + (screen.Height - h) / 2);
Size = new Size(w, h);
}
private void Main_Load(object sender, EventArgs e)
{
lblCallSign.Text = Settings.CallSign.ToString(); //<< This is the area giving me the issues and I am not sure why.
//MessageBox.Show("Hello");
}
}
}
Thank you