Control background color/image
-
Hi All Look at the code using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace DealingWithImages { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.label1 = new System.Windows.Forms.Label(); this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(53, 52); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(211, 13); this.label1.TabIndex = 2; this.label1.Text = "This is windows forms do you like it?"; this.Controls.Add(label1); Image myimage = Image.FromFile(@"Give path of the image"); this.BackgroundImage = myimage; this.MaximumSize = new System.Drawing.Size(400, 400); this.MinimumSize = new System.Drawing.Size(400, 400); } protected override void OnMove(EventArgs e) { base.OnMove(e); this.Refresh(); this.Invalidate(); } protected override void OnPaintBackground(PaintEventArgs e) { if (this.BackgroundImage != null) { e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High; e.Graphics.DrawImage(this.BackgroundImage, 0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height); } else { base.OnPaintBackground(e); } } } } I have to put image on the background of my windows form which I am doing using the code above. I have some controls which I am generating at runtime. Now the challenge is the background color of the control(here label1) looks odd on the form. Does anybody know How to solve it? Thanks Regards THE SK
-
Hi All Look at the code using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace DealingWithImages { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.label1 = new System.Windows.Forms.Label(); this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(53, 52); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(211, 13); this.label1.TabIndex = 2; this.label1.Text = "This is windows forms do you like it?"; this.Controls.Add(label1); Image myimage = Image.FromFile(@"Give path of the image"); this.BackgroundImage = myimage; this.MaximumSize = new System.Drawing.Size(400, 400); this.MinimumSize = new System.Drawing.Size(400, 400); } protected override void OnMove(EventArgs e) { base.OnMove(e); this.Refresh(); this.Invalidate(); } protected override void OnPaintBackground(PaintEventArgs e) { if (this.BackgroundImage != null) { e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High; e.Graphics.DrawImage(this.BackgroundImage, 0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height); } else { base.OnPaintBackground(e); } } } } I have to put image on the background of my windows form which I am doing using the code above. I have some controls which I am generating at runtime. Now the challenge is the background color of the control(here label1) looks odd on the form. Does anybody know How to solve it? Thanks Regards THE SK
label1.BackColor = Color.Transparent;
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
-
label1.BackColor = Color.Transparent;
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
thousands line question One line answer Thanks