I am making/remaking a mail program i wrote quite some time ago.
It directly inserted HTML on the place it was needed what made quite a mess inside the textbox.
Now i wanna do this afterwards to replace things like [-B] TEXT [-/B] with html code so it wont mess up my text.
How ever i wanna do this with 'enters' too but that is where the problem starts.
If i put this code on the keyPressed event then it works all fine(remember Keys.ENTER is equel to 13(enum code)):
It shows inside the output when i press enter.Code:If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then Console.WriteLine("enterpressed") End If
BUT BUT BUT when i try to search to those 'enters' i just cant find them.
This is the code i have:
it just dont find it.Code:For Each s As Char In txtRich.Text.ToCharArray If s = ChrW(Keys.Enter) Then Console.WriteLine("Enter found") End If Next
And i have no idea why :S.
I made it work with comparing the hashcode(after printing the hashcode of the enter char to the output and copy it) but with that cant preform replacements in a string like this:
Wich obviously dont work either.Code:contentToSend = txtRich.Text.Replace(ChrW(13), "<br>")
(on all code samples i tried the normal chr(13) too.)
I hope someone can come with a solution and maybe wanna tell why i cant do this.
Greets




.
Reply With Quote