Using OpenNETCF Community Edition - Display a Control?

  • Thread starter Thread starter Noble
  • Start date Start date
N

Noble

I am using VS2005 and WM5. I also am using the Smart Device Framework
2.0 community edition from OpenNETCF. Can anyone share with me some
example C# code of how to make a Button2 control display on a form?

Thanks in advance,
nb
 
Just like any control. Create it, set the properties and add it to the
Form's Controls collection. See the designer-generated code for any control
for an example, but your code might look like this:

Button2 btn = new Button2();

void MyForm()
{
InitializeComponent();

btn.Height = 100;
btn.Width = 100;
btn.Text = "Hello";
btn.Visible = true;

this.Controls.Add(btn);
}


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
Just like any control. Create it, set the properties and add it to the
Form's Controls collection. See the designer-generated code for any control
for an example, but your code might look like this:

Button2 btn = new Button2();

void MyForm()
{
InitializeComponent();

btn.Height = 100;
btn.Width = 100;
btn.Text = "Hello";
btn.Visible = true;

this.Controls.Add(btn);

}

--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded Worldwww.OpenNETCF.com







- Show quoted text -

Thanks Chris. I will give it shot and see what happens.
nb
 
Back
Top