Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Am I doing the resource access wrong
Message
From
19/07/2007 03:20:19
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Am I doing the resource access wrong
Miscellaneous
Thread ID:
01241787
Message ID:
01241787
Views:
54
This generates no errors, but the cell just shows a red X.
    private void OnDataGridViewCellFormat(object sender, DataGridViewCellFormattingEventArgs e)
      {
      if (this.dataGridView.Columns[e.ColumnIndex].Name == "imgType")
        {
        System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(cdsMessages));
        int iRow = e.RowIndex;
        if (cdsMessageDataSet.Messages[iRow].msgtype == "E")
          {
          e.Value = ((System.Drawing.Bitmap)(resources.GetObject("Work.bmp")));
          }
        else 
          {
          e.Value = ((System.Drawing.Bitmap)(resources.GetObject("PhoneCall.bmp")));
          }
        }
      }
 
I suspect either a wrong argument here:

ResourceManager(typeof(cdsMessages));

or a missing path here:

GetObject("Work.bmp")

But not sure what it should be??

The 2 BMPs are in my Resources folder and marked as Embedded Resource under build action.
Next
Reply
Map
View

Click here to load this message in the networking platform