![]() |
| | #1 |
| Registered User Join Date: Nov 2008
Posts: 34
| i have errors while bulding the code in c# Code: private void subMenuModify_Click(object sender, System.EventArgs e)
{
int nStart = X;
int spos = 0;
int epos = this.lvFiles.Columns[0].Width;
for (int i = 0; i < this.lvFiles.Columns.Count; i++)
{
if (nStart > spos && nStart < epos)
{
subItemSelected = i;
break;
}
spos = epos;
epos += this.lvFiles.Columns[i].Width;
}
subItemText = this.lvItem.SubItems[2].Text;
the exception is as follows: Nullreference exception was unhandled Object reference not set to an instance of an object. Pls anyone help me resolve this issue? |
| leo2008 is offline | |
| | #2 |
| Registered User Join Date: Jun 2008 Location: RING 0
Posts: 468
| Looks like that item doesn't exist in your menu. Make sure there are at least 3 items in your menu or that will not work. |
| valaris is offline | |
| | #3 |
| Registered User Join Date: Nov 2008
Posts: 34
| which item do you think is missing here? u mean "modify item"? |
| leo2008 is offline | |
| | #4 |
| Registered User Join Date: Jun 2008 Location: RING 0
Posts: 468
| Code: subItemText = this.lvItem.SubItems[2].Text; |
| valaris is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Exception handling in a large project | EVOEx | C++ Programming | 7 | 01-25-2009 07:33 AM |
| exception handling | coletek | C++ Programming | 2 | 01-12-2009 05:28 PM |
| Handle C++ exception and structured exception together | George2 | C++ Programming | 2 | 01-24-2008 09:21 PM |
| Signal and exception handling | nts | C++ Programming | 23 | 11-15-2007 02:36 PM |
| Problem with the exception class in MINGW | indigo0086 | C++ Programming | 6 | 01-20-2007 01:12 PM |