Click here to Skip to main content
15,906,708 members
Home / Discussions / C#
   

C#

 
QuestionException in VideoStreamGetFrameOpen Pin
Anandagowda8-Jul-12 16:25
Anandagowda8-Jul-12 16:25 
AnswerRe: Exception in VideoStreamGetFrameOpen Pin
Richard Andrew x648-Jul-12 16:48
professionalRichard Andrew x648-Jul-12 16:48 
GeneralRe: Exception in VideoStreamGetFrameOpen Pin
Anandagowda8-Jul-12 20:14
Anandagowda8-Jul-12 20:14 
Questioncodes Pin
roxxy1238-Jul-12 8:12
roxxy1238-Jul-12 8:12 
AnswerRe: codes Pin
Pete O'Hanlon8-Jul-12 9:53
mvePete O'Hanlon8-Jul-12 9:53 
AnswerRe: codes Pin
Richard Andrew x648-Jul-12 12:37
professionalRichard Andrew x648-Jul-12 12:37 
GeneralRe: codes Pin
Mycroft Holmes8-Jul-12 13:07
professionalMycroft Holmes8-Jul-12 13:07 
AnswerRe: codes Pin
OriginalGriff8-Jul-12 20:08
mveOriginalGriff8-Jul-12 20:08 
QuestionZoom out - in Pin
jojoba20117-Jul-12 22:34
jojoba20117-Jul-12 22:34 
AnswerRe: Zoom out - in Pin
OriginalGriff7-Jul-12 23:04
mveOriginalGriff7-Jul-12 23:04 
GeneralRe: Zoom out - in Pin
Madhan Mohan Reddy P8-Jul-12 23:15
professionalMadhan Mohan Reddy P8-Jul-12 23:15 
QuestionRe: Zoom out - in Pin
Trak4Net9-Jul-12 8:03
Trak4Net9-Jul-12 8:03 
QuestionDatagrid object binding and saving back Pin
Ramkithepower6-Jul-12 23:17
Ramkithepower6-Jul-12 23:17 
AnswerRe: Datagrid object binding and saving back Pin
kornakar10-Jul-12 2:06
kornakar10-Jul-12 2:06 
QuestionC# - window logon events Pin
rupniceguy6-Jul-12 22:20
rupniceguy6-Jul-12 22:20 
AnswerRe: C# - window logon events Pin
Dave Kreskowiak7-Jul-12 3:09
mveDave Kreskowiak7-Jul-12 3:09 
AnswerRe: C# - window logon events Pin
Sunil P V7-Jul-12 3:21
Sunil P V7-Jul-12 3:21 
Questionopen pdf files from my project Pin
shaghyegh6-Jul-12 21:34
shaghyegh6-Jul-12 21:34 
AnswerRe: open pdf files from my project Pin
Mycroft Holmes6-Jul-12 23:13
professionalMycroft Holmes6-Jul-12 23:13 
GeneralRe: open pdf files from my project Pin
Trak4Net9-Jul-12 8:07
Trak4Net9-Jul-12 8:07 
GeneralRe: open pdf files from my project Pin
Dhyanga9-Jul-12 10:27
Dhyanga9-Jul-12 10:27 
GeneralIndex Out of Range Pin
ASPnoob6-Jul-12 16:36
ASPnoob6-Jul-12 16:36 
Hi all,
I 'm trying to loop through a List<T> to see which element in the List is empty, then add strings entered via a text box into the empty element. I tried to display the content of the List element to check what it contains. I Get the error "Index was out of range. Must be non-negative and less than the size of the collection". The following is my code:

//Function to add string dynamically in Class1
private List<string> list1 = new List<string>();
public string AddText(string myText)
{

if(list1[i]=="" & k<1)
{
k = i;
list1[i] = myText;
k++;
}
return list1[i];
}

//Calling AddText() function from Class2
private void btn8_Click(object sender, EventArgs e)
{
string myText = txtDisplay.Text;
ExpressionEval k = new ExpressionEval();
string g = k.AddText(myText);
txtDisplay.Text = g;
}
Please point out why I'm getting this error, thanks in advance.

-- modified 7-Jul-12 9:05am.
GeneralRe: Index Out of Range Pin
ignrod6-Jul-12 17:28
ignrod6-Jul-12 17:28 
GeneralRe: Index Out of Range Pin
ASPnoob6-Jul-12 17:39
ASPnoob6-Jul-12 17:39 
AnswerRe: Index Out of Range Pin
Abhinav S6-Jul-12 17:57
Abhinav S6-Jul-12 17:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.