Overriding TabControl - BackgroundImage

  • Thread starter Thread starter Ken Lee
  • Start date Start date
K

Ken Lee

Hi all,
I'm sort of very new to C# and haven't programmed in OO for a while.
I'm trying to override the backgroundimage to the tabcontrol but it just
doesn't seem to want to do it, can someone please help me and tell me what
I'm doing wrong?

namespace RHInvestmentApplication
{
public class FormRHMain : System.Windows.Forms.Form
{
public class tabMainNewBackground: System.Windows.Forms.TabControl
{
public override Image BackgroundImage
{
set
{
System.Resources.ResourceManager resourcesII = new
System.Resources.ResourceManager(typeof(FormRHMain));
BackgroundImage =
((System.Drawing.Image)(resourcesII.GetObject("tabCustomer.BackgroundImage")
));
}
}
}
private System.Windows.Forms.PictureBox ImgRHLogo;
private System.Windows.Forms.PictureBox ImgISNLogo;
private System.Windows.Forms.TabPage tabCustomer;
private RHInvestmentApplication.FormRHMain.tabMainNewBackground tabMain;
private System.Windows.Forms.TabPage tabAppointment;

private System.ComponentModel.Container components = null;

public FormRHMain()
{
InitializeComponent();
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code

private void InitializeComponent()
{
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(FormRHMain));
this.ImgRHLogo = new System.Windows.Forms.PictureBox();
this.tabMain = new
RHInvestmentApplication.FormRHMain.tabMainNewBackground();
this.tabCustomer = new System.Windows.Forms.TabPage();
this.tabAppointment = new System.Windows.Forms.TabPage();
this.ImgISNLogo = new System.Windows.Forms.PictureBox();
this.tabMain.SuspendLayout();
this.SuspendLayout();
//
// ImgRHLogo
//
this.ImgRHLogo.Image =
((System.Drawing.Bitmap)(resources.GetObject("ImgRHLogo.Image")));
this.ImgRHLogo.Location = new System.Drawing.Point(8, 16);
this.ImgRHLogo.Name = "ImgRHLogo";
this.ImgRHLogo.Size = new System.Drawing.Size(512, 72);
this.ImgRHLogo.TabIndex = 0;
this.ImgRHLogo.TabStop = false;
//
// tabMain
//
this.tabMain.Anchor = (((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.tabMain.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tabCustomer,
this.tabAppointment});
this.tabMain.Font = new System.Drawing.Font("Verdana", 9.75F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
((System.Byte)(0)));
this.tabMain.ItemSize = new System.Drawing.Size(82, 26);
this.tabMain.Location = new System.Drawing.Point(15, 100);
this.tabMain.Name = "tabMain";
this.tabMain.Padding = new System.Drawing.Point(5, 5);
this.tabMain.Appearance = System.Windows.Forms.TabAppearance.Buttons;
this.tabMain.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tabMain.SelectedIndex = 0;
this.tabMain.Size = new System.Drawing.Size(760, 500);
this.tabMain.TabIndex = 1;
//
// tabCustomer
//
this.tabCustomer.BackgroundImage =
((System.Drawing.Bitmap)(resources.GetObject("tabCustomer.BackgroundImage"))
);
this.tabCustomer.Location = new System.Drawing.Point(4, 30);
this.tabCustomer.Name = "tabCustomer";
this.tabCustomer.Size = new System.Drawing.Size(752, 466);
this.tabCustomer.TabIndex = 0;
this.tabCustomer.Text = "Customer";
//
// tabAppointment
//
this.tabAppointment.BackgroundImage =
((System.Drawing.Bitmap)(resources.GetObject("tabAppointment.BackgroundImage
")));
this.tabAppointment.Location = new System.Drawing.Point(4, 30);
this.tabAppointment.Name = "tabAppointment";
this.tabAppointment.Size = new System.Drawing.Size(752, 466);
this.tabAppointment.TabIndex = 1;
this.tabAppointment.Text = "Appointment";
//
// ImgISNLogo
//
this.ImgISNLogo.Anchor = (System.Windows.Forms.AnchorStyles.Bottom |
System.Windows.Forms.AnchorStyles.Right);
this.ImgISNLogo.Image =
((System.Drawing.Bitmap)(resources.GetObject("ImgISNLogo.Image")));
this.ImgISNLogo.Location = new System.Drawing.Point(624, 616);
this.ImgISNLogo.Name = "ImgISNLogo";
this.ImgISNLogo.Size = new System.Drawing.Size(150, 49);
this.ImgISNLogo.TabIndex = 2;
this.ImgISNLogo.TabStop = false;
//
// FormRHMain
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackgroundImage =
((System.Drawing.Bitmap)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(792, 673);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.ImgISNLogo,
this.tabMain,
this.ImgRHLogo});
this.Name = "FormRHMain";
this.Text = "FormRHMain";
this.Load += new System.EventHandler(this.FormRHMain_Load);
this.tabMain.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion

[STAThread]
static void Main()
{
Application.Run(new FormRHMain());
}

private void FormRHMain_Load(object sender, System.EventArgs e)
{

}

private void tabPageAppointment_Click(object sender, System.EventArgs e)
{

}

private void ImgISNLogo_Click(object sender, System.EventArgs e)
{

}
}
}
 
Back
Top