Label backgound color in a OpenNETCF GroupBox

  • Thread starter Thread starter augustesen
  • Start date Start date
A

augustesen

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
 
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

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
 
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
 
Try upgrading to SP3.
http://www.microsoft.com/downloads/...11-194b-4c00-b445-f92bec03032f&displaylang=en

--
Tim Wilson
..NET Compact Framework MVP

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
 
Back
Top