all groups > dotnet compact framework > september 2005 >
You're in the

dotnet compact framework

group:

Label backgound color in a OpenNETCF GroupBox


Label backgound color in a OpenNETCF GroupBox augustesen NO[at]SPAM privat.tdcadsl.dk
9/30/2005 4:36:36 AM
dotnet compact framework: Hi all.

I am having some problems with using the GroupBox from OpenNETCF.

I have a form with a button that calls an About form, which is
generated at runtime. On this About form there is a GroupBox and some
labels.

The problem I have is that the background color on the labels have the
same color as the main form, and not the About form - does anyone know
how to fix this? I would appriciate it very much.

This is how I declare the Label

this.lblLinje4 =3D new Label();
this.lblLinje4.BackColor =3D Color.LightGray;
this.lblLinje4.Font =3D new Font("Courier New", 11,
FontStyle.Regular);
this.lblLinje4.Text =3D "GTC";
this.lblLinje4.Size =3D new Size(this.Width - 40, 20);
this.lblLinje4.Location =3D new Point(10, 110);
this.group.Controls.Add(this.lblLinje4);

Where 'lblLinje4' is the label and 'group' =EDs the GroupBox.

Can anyone help?

Regards
S=F8ren Augustesen
Re: Label backgound color in a OpenNETCF GroupBox augustesen NO[at]SPAM privat.tdcadsl.dk
9/30/2005 5:39:43 AM
Hi Tim

Thanks for the feedback.

Setting the BackColor of the label does not change anything, and
leaving it out or keeping it in does not change anything either. The
label.ForeColor works as it should.

I am using OpenNETCF ver 1.3, and I am not sure I have the lastest .NET
service pack. I will try and download the newest service pack and see
if that helps.

Regards
S=F8ren Augustesen
Re: Label backgound color in a OpenNETCF GroupBox Tim Wilson
9/30/2005 8:08:35 AM
There is an issue in the latest release of the SDF where a CF Label will not
properly take on the backcolor of the GroupBox if left unset. However, if
you explicitly set the backcolor for the Label then there should not be a
problem. Does setting the backcolor of the Label change its value in your
case? Are you using the latest service pack?

--
Tim Wilson
..NET Compact Framework MVP

[quoted text, click to view]
Hi all.

I am having some problems with using the GroupBox from OpenNETCF.

I have a form with a button that calls an About form, which is
generated at runtime. On this About form there is a GroupBox and some
labels.

The problem I have is that the background color on the labels have the
same color as the main form, and not the About form - does anyone know
how to fix this? I would appriciate it very much.

This is how I declare the Label

this.lblLinje4 = new Label();
this.lblLinje4.BackColor = Color.LightGray;
this.lblLinje4.Font = new Font("Courier New", 11,
FontStyle.Regular);
this.lblLinje4.Text = "GTC";
this.lblLinje4.Size = new Size(this.Width - 40, 20);
this.lblLinje4.Location = new Point(10, 110);
this.group.Controls.Add(this.lblLinje4);

Where 'lblLinje4' is the label and 'group' ís the GroupBox.

Can anyone help?

Regards
Søren Augustesen

Re: Label backgound color in a OpenNETCF GroupBox Tim Wilson
9/30/2005 9:11:57 AM
Try upgrading to SP3.
http://www.microsoft.com/downloads/details.aspx?FamilyID=a5a02311-194b-4c00-b445-f92bec03032f&displaylang=en

--
Tim Wilson
..NET Compact Framework MVP

[quoted text, click to view]
Hi Tim

Thanks for the feedback.

Setting the BackColor of the label does not change anything, and
leaving it out or keeping it in does not change anything either. The
label.ForeColor works as it should.

I am using OpenNETCF ver 1.3, and I am not sure I have the lastest .NET
service pack. I will try and download the newest service pack and see
if that helps.

Regards
Søren Augustesen

AddThis Social Bookmark Button