Imagelist not working if OpenNETCF SDF is used

G

Girish NS

Hi,

I think that the problem of imagelist control populated with image(s) giving
runtime error occurs when u have the LinkLabel control of OpenNETCF SDE. I
created a smart device application with a form containing a LinkLabel
control and a imagelist with one image. When I run this application I'm
getting a run time error with the following message:

An unhandled exception of type 'System.TypeLoadException' occurred in
mscorlib.dll

Additional information: OpenNETCF.Windows.Forms.ControlModeEnum,
OpenNETCF.Windows.Forms, Version=1.0.2904.0, Culture=neutral,
PublicKeyToken=30c767b29d52d6e6

Here is the code snippet which generated this error

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;

namespace SmartDeviceApplication1
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private OpenNETCF.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.MainMenu mainMenu1;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(Form1));
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.linkLabel1 = new OpenNETCF.Windows.Forms.LinkLabel();
this.imageList1 = new System.Windows.Forms.ImageList();
//
// linkLabel1
//
this.linkLabel1.LinkData = "http://opennetcf.org";
this.linkLabel1.Location = new System.Drawing.Point(72, 40);
this.linkLabel1.Size = new System.Drawing.Size(75, 23);
this.linkLabel1.Text = "linkLabel1";
//
// imageList1
//

this.imageList1.Images.Add(((System.Drawing.Image)(resources.GetObject("reso
urce"))));
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
//
// Form1
//
this.Controls.Add(this.linkLabel1);
this.MaximizeBox = false;
this.Menu = this.mainMenu1;
this.MinimizeBox = false;
this.Text = "Form1";

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>

static void Main()
{
Application.Run(new Form1());
}
}
}


Has anybody encountered this situation and found out a fix for this error? I
have been trying unsuccessfully for the past 4 days. I need a fix quickly
for the application which I'm doing.

Thanks for any valuable suggestions.

Girish.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top