コード例 #1
0
 public void ReplaceSmileCode(String code, Bitmap bmp)
 {
     if (tb.InvokeRequired)
     {
         ReplaceSmileCodeCB d = new ReplaceSmileCodeCB(ReplaceSmileCode);
         try
         {
             tb.Parent.Invoke(d, new object[] { code, bmp });
         }
         catch { }
     }
     else
     {
         int start = tb.Text.Substring(0).IndexOf(code);
         while (start > 0)
         {
             if (start > 0)
             {
                 tb.SelectionStart  = start;
                 tb.SelectionLength = code.Length;
                 //tb.Cut();
                 tb.InsertImage(bmp);
             }
             start = tb.Text.Substring(0).IndexOf(code);
         }
     }
 }
コード例 #2
0
ファイル: Log.cs プロジェクト: jfarre20/Ubiquitous
 public void ReplaceSmileCode(String code, Bitmap bmp)
 {
     if (tb.InvokeRequired)
     {
         ReplaceSmileCodeCB d = new ReplaceSmileCodeCB(ReplaceSmileCode);
         try
         {
             tb.Parent.Invoke(d, new object[] { code,bmp });
         }
         catch { }
     }
     else
     {
         int start = tb.Text.Substring(0).IndexOf(code);
         while (start > 0)
         {
             if (start > 0)
             {
                 tb.SelectionStart = start;
                 tb.SelectionLength = code.Length;
                 //tb.Cut();
                 tb.InsertImage(bmp);
             }
             start = tb.Text.Substring(0).IndexOf(code);
         }
     }
 }