connected within this topic: How to connect string from my class to form
im trying to do solutions related to their answers (specifically answer of sir Jeremy) but this error keeps on appearing
'KeyWord.KeyWord.keywords' is inaccessible due to its protection level
code for KeyWords.cs:
namespace KeyWord
{
public class KeyWord
{
String[] keywords = { "abstract", "as", "etc." };
}
}
code for main.cs
// Check whether the token is a keyword.
var keyboardCls = new KeyWord.KeyWord();
String[] keywords = keyboardCls.keywords;
for (int i = 0; i < keywords.Length; i++)
{
if (keywords[i] == token)
{
// Apply alternative color and font to highlight keyword.
rtb.SelectionColor = Color.Blue;
rtb.SelectionFont = new Font("Courier New", 10, FontStyle.Bold);
break;
}
}
what should i do?
set
method – Octuple