473,320 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Overriding TabControl - BackgroundImage

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("tab Customer.BackgroundImage")
));
}
}
}
private System.Windows.Forms.PictureBox ImgRHLogo;
private System.Windows.Forms.PictureBox ImgISNLogo;
private System.Windows.Forms.TabPage tabCustomer;
private RHInvestmentApplication.FormRHMain.tabMainNewBackg round 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.tabMainNewBackg round();
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("ImgR HLogo.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("tabC ustomer.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("tabA ppointment.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("ImgI SNLogo.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("$thi s.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)
{

}
}
}
Nov 15 '05 #1
0 4643

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DraguVaso | last post by:
Hi, I 'wrote' my own DataGrid, using the normal DataGrid, and overriding some of the DataGridTextBoxColumn-methods (mostly the Paint-method). I based most of my changes on the Windows Form FAQ:...
14
by: Dino M. Buljubasic | last post by:
I would like to be able to compare BackgroundImage Property of two picture boxes on my form. How can I do that? I am using : if (pctOne.BackgroundImage Is pctTwo.BackgroundImage) then //...
6
by: Mike | last post by:
Hi, I have such problem: On my form I have TabControl. I want to move from one tab to another using "Next" and "Prev" button. This part works fine. But control also supports switching between...
1
by: kjon | last post by:
Hi, I'm trying to get the BackgroundImage of a form/control and draw it again in runtime. But if the Backgroundimage is "None", the DrawImage command will give an error. Is it possible to...
1
by: John | last post by:
Hello all, I was wondering, does this property really exist in VB.NET 2003? Because it's listed in Intellisense, but setting it doesn't seem to have the slightest effect on the visual look of...
1
by: VB Programmer | last post by:
I am trying to check which image is currently the BackgroundImage (VB.NET 2005). Can you help me out? Me.BackgroundImage.ToString doesn't work. Here's the sample code... Select Case...
12
by: Sharon | last post by:
I’m using a Panel control in my form to display a background image. So in the Form OnPaint() I wrote: myPanel.BackgroundImage = m_bmp; While the m_bmp is the Form Bitmap member. The problem...
1
by: moi.romanowsky | last post by:
Does anyone know why the backgroundImage does not display in VB? I have tried setting it in the properties window (where the thumbnail shows) and explicitly in my code like so: ...
3
by: fehays | last post by:
Hello, Can someone please tell me why this code leaks? The handle count for IE continues to increase. var newimage = "url(images/" + res.value.Image + ")"; if( imagetd.style.backgroundImage...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.