Click here to Skip to main content
15,915,093 members
Home / Discussions / C#
   

C#

 
AnswerRe: MIDI to Guitar Tablature Pin
Christian Graus19-Nov-06 9:35
protectorChristian Graus19-Nov-06 9:35 
GeneralRe: MIDI to Guitar Tablature Pin
ejuanpp19-Nov-06 22:50
ejuanpp19-Nov-06 22:50 
GeneralRe: MIDI to Guitar Tablature Pin
Christian Graus19-Nov-06 23:04
protectorChristian Graus19-Nov-06 23:04 
GeneralRe: MIDI to Guitar Tablature Pin
ejuanpp19-Nov-06 23:23
ejuanpp19-Nov-06 23:23 
GeneralRe: MIDI to Guitar Tablature Pin
Christian Graus19-Nov-06 23:38
protectorChristian Graus19-Nov-06 23:38 
AnswerRe: MIDI to Guitar Tablature Pin
ednrgc20-Nov-06 3:56
ednrgc20-Nov-06 3:56 
QuestionUsing a C# user control in VB 6.0 Pin
Alin Sarivan19-Nov-06 6:58
Alin Sarivan19-Nov-06 6:58 
Questioncompile error Pin
wanlim081719-Nov-06 6:29
wanlim081719-Nov-06 6:29 
This is my code:
#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace Enumerable
{
public class ListBoxTest : IEnumerable<string>
{
private string[] strings;
private int ctr = 0;
// Enumerable classes can return an enumerator
public IEnumerator<string> GetEnumerator( )
{
foreach ( string s in strings )
{
yield return s;
}
}

// initialize the list box with strings
public ListBoxTest( params string[] initialStrings )
{
// allocate space for the strings
strings = new String[8];

// copy the strings passed in to the constructor
foreach ( string s in initialStrings )
{
strings[ctr++] = s;
}
}

// add a single string to the end of the list box
public void Add( string theString )
{
strings[ctr] = theString;
ctr++;
}

// allow array-like access
public string this[int index]
{
get
{
if ( index < 0 || index >= strings.Length )
{
// handle bad index
}
return strings[index];
}
set
{
strings[index] = value;
}
}

// publish how many strings you hold
public int GetNumEntries( )
{
return ctr;
}
}

public class Tester
{
static void Main( )
{
// create a new list box and initialize
ListBoxTest lbt =
new ListBoxTest( "Hello", "World" );

// add a few strings
lbt.Add( "Who" );
lbt.Add( "Is" );
lbt.Add( "John" );
lbt.Add( "Galt" );

// test the access
string subst = "Universe";
lbt[1] = subst;

// access all the strings
foreach ( string s in lbt )
{
Console.WriteLine( "Value: {0}", s );
}
}
}

}
When I compile this code in the VS2005,the error ocurrs as following:

Error 1 'Enumerable.ListBoxTest' does not implement interface member 'System.Collections.IEnumerable.GetEnumerator()'. 'Enumerable.ListBoxTest.GetEnumerator()' is either static, not public, or has the wrong return type. E:\李良\WorkSpace\Test\Test\Program.cs 11 18 Test

I have implemented the GetEnumerator();what's wrong with this? Thank you!
AnswerRe: compile error Pin
Ravi Bhavnani19-Nov-06 6:36
professionalRavi Bhavnani19-Nov-06 6:36 
QuestionProblem with splitter control Pin
h@s@n19-Nov-06 6:18
h@s@n19-Nov-06 6:18 
QuestionHow to make MS Office 2007 Interface? Pin
mohamedyahyaelzayat19-Nov-06 5:40
mohamedyahyaelzayat19-Nov-06 5:40 
AnswerRe: How to make MS Office 2007 Interface? Pin
Ed.Poore19-Nov-06 8:43
Ed.Poore19-Nov-06 8:43 
GeneralRe: How to make MS Office 2007 Interface? Pin
mohamedyahyaelzayat19-Nov-06 11:53
mohamedyahyaelzayat19-Nov-06 11:53 
Questionhow can we give professional (XP) look to application. Pin
h@s@n19-Nov-06 5:29
h@s@n19-Nov-06 5:29 
AnswerRe: how can we give professional (XP) look to application. Pin
Stefan Troschuetz19-Nov-06 5:37
Stefan Troschuetz19-Nov-06 5:37 
GeneralRe: how can we give professional (XP) look to application. Pin
h@s@n19-Nov-06 6:01
h@s@n19-Nov-06 6:01 
AnswerRe: how can we give professional (XP) look to application. Pin
mav.northwind19-Nov-06 5:45
mav.northwind19-Nov-06 5:45 
GeneralRe: how can we give professional (XP) look to application. Pin
mohamedyahyaelzayat19-Nov-06 6:06
mohamedyahyaelzayat19-Nov-06 6:06 
GeneralRe: how can we give professional (XP) look to application. Pin
h@s@n19-Nov-06 6:22
h@s@n19-Nov-06 6:22 
GeneralRe: how can we give professional (XP) look to application. Pin
mav.northwind19-Nov-06 6:27
mav.northwind19-Nov-06 6:27 
GeneralRe: how can we give professional (XP) look to application. Pin
h@s@n19-Nov-06 6:45
h@s@n19-Nov-06 6:45 
QuestionXml Data Storage Pin
ciriciri19-Nov-06 4:00
ciriciri19-Nov-06 4:00 
AnswerRe: Xml Data Storage Pin
Ravi Bhavnani19-Nov-06 6:40
professionalRavi Bhavnani19-Nov-06 6:40 
QuestionError while opening windows form in Solution Pin
kumar.bs18-Nov-06 22:29
kumar.bs18-Nov-06 22:29 
Questiongetting text from another application Pin
MrWhite34018-Nov-06 22:06
MrWhite34018-Nov-06 22:06 

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.