-
August 31st, 2011, 09:46 PM
#1
[RESOLVED] .NET4.0 / VS 2010>Does Not Exsist In Current Context error
I just don't know what to do with this. Can someone help?
Code:
using Microsoft.Win32.SafeHandles;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Data;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace Test1
{
public partial class UserControl1 : UserControl
{
private int unitOfMeasure = 0;
public int UnitOfMeasure
{
get { return unitOfMeasure; }
set { unitOfMeasure = value; }
}
public int MeterTypeSelected = 0;
public string[,] UOMText = new string[48, 48];
public string TempMeterTitle = "TempTitle";
public UserControl1()
{
InitializeComponent();
//ToDo: Fill UOMText Array
}
private void timer1_Tick(object sender, EventArgs e)
{
lblUOM.Text = UOMText(MeterTypeSelected, UnitOfMeasure);
lblMeterTitle.Text = TempMeterTitle.ToString();
}
}
}
The problem is with the line (Under the timer1_tick near the end of the page):
lblUOM.Text = UOMText(MeterTypeSelected, UnitOfMeasure);
The error is: "The name 'UOMText' does not exsist in the current context."
What I find puzzling is the next line does not have the issue. Hmm...
What do I need to do to fix this?
Thanks
-
August 31st, 2011, 09:56 PM
#2
Re: .NET4.0 / VS 2010>Does Not Exsist In Current Context error
That is a strange exception to receive regarding that particular object... I would expect something like 'using a variable like a method' in your case....
To access an array item, use brackets [ ] rather than parens ( ) .... ie:
Code:
string item = UOMText[1,1];
Best of luck!
-
September 1st, 2011, 09:12 AM
#3
Re: .NET4.0 / VS 2010>Does Not Exsist In Current Context error
Thanks fcronin!
Wow, I don't think I would ever figured that one out, brackets rather than parens!
You solved my problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|