First of all create a windows form project in visual studio and drag three buttons on the form and a textbox(you can add further controls but these are minimum controls needed).
Declare following global variables.\
private string inputString = ""; private int count = 0; private static readonly Dictionary<string, string> mapping = new Dictionary<string, string>() { { ".-","a" }, { "-...","b" }, { "-.-.", "c"}, { "-..","d" }, { "." ,"e"}, ...