This seemingly simple for whatever reason is not working. Specifically the Foreach Loop is giving me this error "Error 1 Cannot convert type 'char' to 'string'". I have done some research although it does not want to reveal its self. Hopefully you guys will know, thanks so much for the help.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace A_HtmlEditor
{
public partial class Form1 : Form
{
AutoCompleteStringCollection data = new AutoCompleteStringCollection();
public Form1()
{
InitializeComponent();
}
// The error occurs in the foreach loop below
private void textBox1_TextChanged(object sender, EventArgs e)
{
webBrowser1.DocumentText = textBox1.Text;
foreach(string s in textBox1.Text)
{
data.Add(s);
}
}
}
}
As an aside I was wondering while I am here, do any of you happen to know whether or not it is possible to find out if there was a button click, such as the shutdown button? Or if that is not possible is there a way to know when a computer is about to be shutdown.
Once again I appreciate it all, Thanks.