Visual basic coding, how do I do this?
Under any event (button click, text changed etc.) how do I remove all "-" characters from a textbox?
My textbox is named Resultbox.
Under any event (button click, text changed etc.) how do I remove all "-" characters from a textbox?
My textbox is named Resultbox.
husoski
Favorite Answer
The Resultbox.text field is a regular VB string, so you can do anything with it that you can with any other string. See
msdn.microsoft.com/en-us/library/dd789093.aspx
The function you want is Replace:
Resultbox.text = Replace(Resultbox.text, "-", "")
More about Replace at:
http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.strings.replace.aspx
Aleks
me.Resultbox = replace(me.Resultbox,"-","")
Anonymous
resultbox.text = ""