I'm programming in C# for a PPC, and trying to display an image from the
start, i.e. as soon as the program launches. I've tried (as explained in
Microsoft's .NET Compact Framework book) to use two different methods to
display an image on the PDA. They work fine, but I need to click a button
first (for example a radio button) for the image to display. I'd simply like
to show the image as soon as the program starts. If I use the following code
I'll be able to see the picture if clicking on the radio button. How do I
load up the image straight away as soon as I start the program? Thanks a
lot!
jez
***
using System;
using System.Drawing;
using System.Collecti ons;
using System.IO;
using System.Windows. Forms;
using System.Data;
using System.Reflecti on;
namespace SmartDeviceAppl ication3 {
public class Form1 : System.Windows. Forms.Form {
private System.Windows. Forms.PictureBo x pictureBox1;
private System.Windows. Forms.MainMenu mainMenu1;
public Form1()
{
InitializeCompo nent();
}
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
private void InitializeCompo nent()
{
this.mainMenu1 = new System.Windows. Forms.MainMenu( );
this.pictureBox 1 = new System.Windows. Forms.PictureBo x();
this.pictureBox 1.Location = new System.Drawing. Point(48, 40);
this.pictureBox 1.Size = new System.Drawing. Size(144, 176);
this.Controls.A dd(this.picture Box1);
this.Menu = this.mainMenu1;
this.Text = "Form1";
}
static void Main()
{
Application.Run (new Form1());
}
private void Form1_Load(obje ct sender, System.EventArg s e)
{
LoadFromEmbedde d();
}
private void LoadFromEmbedde d()
{
Bitmap imageFromEmbedd ed = new
Bitmap(Assembly .GetExecutingAs sembly().GetMan ifestResourceSt ream("NETCFDeve l
opersReference. mypicture.bmp") );
pictureBox1.Ima ge = imageFromEmbedd ed;
}
private void radioButton1_Ch eckedChanged(ob ject sender, System.EventArg s
e)
{
if (radioButton1.C hecked == true)
LoadFromEmbedde d();
}
}
}
start, i.e. as soon as the program launches. I've tried (as explained in
Microsoft's .NET Compact Framework book) to use two different methods to
display an image on the PDA. They work fine, but I need to click a button
first (for example a radio button) for the image to display. I'd simply like
to show the image as soon as the program starts. If I use the following code
I'll be able to see the picture if clicking on the radio button. How do I
load up the image straight away as soon as I start the program? Thanks a
lot!
jez
***
using System;
using System.Drawing;
using System.Collecti ons;
using System.IO;
using System.Windows. Forms;
using System.Data;
using System.Reflecti on;
namespace SmartDeviceAppl ication3 {
public class Form1 : System.Windows. Forms.Form {
private System.Windows. Forms.PictureBo x pictureBox1;
private System.Windows. Forms.MainMenu mainMenu1;
public Form1()
{
InitializeCompo nent();
}
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
private void InitializeCompo nent()
{
this.mainMenu1 = new System.Windows. Forms.MainMenu( );
this.pictureBox 1 = new System.Windows. Forms.PictureBo x();
this.pictureBox 1.Location = new System.Drawing. Point(48, 40);
this.pictureBox 1.Size = new System.Drawing. Size(144, 176);
this.Controls.A dd(this.picture Box1);
this.Menu = this.mainMenu1;
this.Text = "Form1";
}
static void Main()
{
Application.Run (new Form1());
}
private void Form1_Load(obje ct sender, System.EventArg s e)
{
LoadFromEmbedde d();
}
private void LoadFromEmbedde d()
{
Bitmap imageFromEmbedd ed = new
Bitmap(Assembly .GetExecutingAs sembly().GetMan ifestResourceSt ream("NETCFDeve l
opersReference. mypicture.bmp") );
pictureBox1.Ima ge = imageFromEmbedd ed;
}
private void radioButton1_Ch eckedChanged(ob ject sender, System.EventArg s
e)
{
if (radioButton1.C hecked == true)
LoadFromEmbedde d();
}
}
}