ellerre
asked on
C#, PocketPC, step #2
I wrote these few C# lines in .NET Compact Framework:
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
namespace SmartDeviceApplication
{
public class Form1:Form
{
Button btnTest = new Button();
Panel pnlTest;
public Form1()
{
this.Text="Just4Fun";
// the panel...
pnlTest=new Panel();
pnlTest.Size=new Size(200,200);
// ...and BackColor works fine...
pnlTest.BackColor=Color.Ye llow;
// the button...
btnTest=new Button();
btnTest.Size=new Size(150,100);
btnTest.Location=new Point(25,50);
// ...and the back color is always gray!
btnTest.BackColor=Color.Pu rple;
// papaya???
btnTest.ForeColor=Color.Pa payaWhip;
btnTest.Text="PURPLE RAIN...\ntest";
// the event OnClick
//btnTest.Click+=new EventHandler(btn_clk);
pnlTest.Controls.Add(btnTe st);
this.Controls.Add(pnlTest) ;
}
private static void Main()
{
Application.Run(new Form1());
}
}
}
and the panel "BackColor" is working fine but the button "Back & ForeColor" are not working.
What I did wrong?
...maybe my .NET is a Balck&White version??? :-)
Thanks 4 your help...
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
namespace SmartDeviceApplication
{
public class Form1:Form
{
Button btnTest = new Button();
Panel pnlTest;
public Form1()
{
this.Text="Just4Fun";
// the panel...
pnlTest=new Panel();
pnlTest.Size=new Size(200,200);
// ...and BackColor works fine...
pnlTest.BackColor=Color.Ye
// the button...
btnTest=new Button();
btnTest.Size=new Size(150,100);
btnTest.Location=new Point(25,50);
// ...and the back color is always gray!
btnTest.BackColor=Color.Pu
// papaya???
btnTest.ForeColor=Color.Pa
btnTest.Text="PURPLE RAIN...\ntest";
// the event OnClick
//btnTest.Click+=new EventHandler(btn_clk);
pnlTest.Controls.Add(btnTe
this.Controls.Add(pnlTest)
}
private static void Main()
{
Application.Run(new Form1());
}
}
}
and the panel "BackColor" is working fine but the button "Back & ForeColor" are not working.
What I did wrong?
...maybe my .NET is a Balck&White version??? :-)
Thanks 4 your help...
What version of Compact Framework are you using, I believe CF 1.0's Buttons did not actually implement the BackColor property whereas SP2 supposedly has addressed the lack of the BackColor implementation.
Umm, interestingly I've looked into this a little further as I just realised I haven't got SP2 :-) and Compact Framework SP2 appears to have been recalled "because of some issues" whatever that means.
ASKER
I should have the last version of both .NET 2003 and Compact Framework.
I'm saying "should" because, if i try to update it, the answer is: "You have the last version... No upgrade avaiable" (bad translation from italian language, I know).
The best is that a lot of examples from Microsoft are not working because or a "method is not valid" or "this class do not accept only 2 parameters" and so on.
well... another Plug and... Pray system?
I'm saying "should" because, if i try to update it, the answer is: "You have the last version... No upgrade avaiable" (bad translation from italian language, I know).
The best is that a lot of examples from Microsoft are not working because or a "method is not valid" or "this class do not accept only 2 parameters" and so on.
well... another Plug and... Pray system?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.