Note that there are some explanatory texts on larger screens.

plurals
  1. POc# text difference
    primarykey
    data
    text
    <p>I have two words:<br> Source: John<br> ConvertTo: Jack</p> <p>and I want to show the effect of convert all letters from "Source" at the same time to the "ConvertTo" word. I already create a program to accomplish that but processing one letter at a time, to show the effect I use Threads, the thing is that to process all letters at the same time I suppose I need one thread per letter, and every thread will call the same function that process the letter, and I use global variables.</p> <p>Here is the code (works only for texts with same lenght):</p> <pre><code>private void button1_Click(object sender, EventArgs e) { lblResult.Text = ""; lblResult2.Text = ""; ThreadPool.QueueUserWorkItem(new WaitCallback(Process)); } int movement = 0; string CumulateText; private void Process(object stateinfo) { int value; int operation; //0-&gt;[+] 1-&gt;[-] CumulateText = ""; for (int i = 0; i &lt;= textBox1.Text.Length - 1; i++) { if (textBox1.Text[i] != ' ') { value = (char)textBox1.Text[i] - (char)textBox2.Text[i]; if (value &gt;= 0) operation = 1; else operation = 0; for (int ii = 0; ii &lt;= Math.Abs(value); ii++) { if (operation == 1) movement = (char)textBox1.Text[i] - ii; else movement = (char)textBox1.Text[i] + ii; this.Invoke(new EventHandler(ShowMovement)); System.Threading.Thread.Sleep(10); } } CumulateText += textBox2.Text[i].ToString(); } } private void ShowMovement(object sender, EventArgs e) { lblResult.Text = CumulateText + Convert.ToString((char)movement); } </code></pre> <p>I hope I made myself understood. please any advise to accomplish that. thanks</p> <p>To clarify more what I want to accomplish here is an example:<br> Source: John<br> ConvertTo: Jack </p> <p>J - same J<br> o - decrease till a (o, n, m, ..., a)<br> h - decrease till c (h, g, f, ..., c)<br> n - decrease till k (n, m, l, k)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload