S
Steven C
Hello:
This should be a simply question for most of you guys. Obviously, I'm
new to C#. I'm trying to add a base form objects base class to my
project, so I can pre-configure textboxes, combos, etc, with a blue
backcolor, to be used on all my forms. I compiled this, but when I
use it on my form, the custom control properties are not being set.
What am I missing here? Many thanks!
Steven
using System;
using System.Windows.Forms;
using System.Drawing;
namespace Chrismon.Form.Objects
{
public class ChrismonTextBox : TextBox
{
public ChrismonTextBox()
{
TextBox ChrismonTextBox = new TextBox();
ChrismonTextBox.BackColor = Color.Blue;
ChrismonTextBox.Width = 200;
ChrismonTextBox.Height = 40;
}
}
}
This should be a simply question for most of you guys. Obviously, I'm
new to C#. I'm trying to add a base form objects base class to my
project, so I can pre-configure textboxes, combos, etc, with a blue
backcolor, to be used on all my forms. I compiled this, but when I
use it on my form, the custom control properties are not being set.
What am I missing here? Many thanks!
Steven
using System;
using System.Windows.Forms;
using System.Drawing;
namespace Chrismon.Form.Objects
{
public class ChrismonTextBox : TextBox
{
public ChrismonTextBox()
{
TextBox ChrismonTextBox = new TextBox();
ChrismonTextBox.BackColor = Color.Blue;
ChrismonTextBox.Width = 200;
ChrismonTextBox.Height = 40;
}
}
}