private void showBoxStripMenu_AddText_Click(object sender, EventArgs e) { string[] str = GCInputMessageBox.Show(); string text = str[0]; string font = str[1]; float size = float.Parse(str[2]); if (text.Length == 0) { return; } HashSet <char> set = new HashSet <char>(); foreach (var c in text) { if (c != ' ') { set.Add(c); } } TreeNode root = new TreeNode("字符串:[" + text[0] + "...]"); Dictionary <string, GCImage> imagePairs = new Dictionary <string, GCImage>(); foreach (var c in set) { root.Nodes.Add(c.ToString()); imagePairs.Add(c.ToString(), new GCImage(c, new Font(font, size, FontStyle.Regular, GraphicsUnit.Pixel))); } if (root.Nodes.Count != 0) { root.Tag = imagePairs; imageTreeView.Nodes.Add(root); } }
public static new string[] Show() { GCInputMessageBox inputMessageBox = new GCInputMessageBox(); inputMessageBox.ShowDialog(); return(new string[] { inputMessageBox.text, inputMessageBox.font, inputMessageBox.size }); }