How can I make a graphic in C# when I use drag and drop functionality with string types from a word document? The idea is that I want to make a graphic which represents the length of the words that I should drag and drop.
In the program which I coded, the functionality is dragging and dropping numbers and make a graphic which shows the difference between their values.
For example, I want to drag and drop 'Book, Pen' on a graphic that I already have on my WindowsForms in the moment of starting the program and The Bar Chart reflects first column bigger than the second one. Book-> 4 letters; Pen-> 3 letters
public class Grafic: Control
{
int[] valori;
private void Grafic_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(typeof(string)))
{
string valoriString =
(string)e.Data.GetData(typeof(string));
//MessageBox.Show(valoriString);
Valori = valoriString
.Split(',')
.Select(val => int.Parse(val))
.ToArray();
}
}
So this is my problem and i have to modify in some way the part of the code where is that int.Parse(val).
I expect the graphic accept the string types and reflect what I described.