Can't change desktopTextField.text

Hi.

I’m crazy! Yes, i am!

Look for this part of my code:

at the: Dim t As String = Me.Text
the t is “(11)98542-1409”

at the: t = limpaTexto
the t is 11985421409

after the: me.text=t
the me.text is “(11)98542-1409”

why???

the t variable:

the “me” variable:

if after the me.text=t
i do me.text=“123”
the me.text changes the value.

why?

what i’m doing wrong?

i made a video:

Not sure—but why aren’t you just dimming t with the new value? Or simply doing “Me.Text=limpaTexto”?

Edit: well, the code isn’t quite the same in the video. Here, it looks like limpaTexto is a function that passes t to return a modified t. But then you just change t to “123”. So I’m not quite sure what you’re doing :slight_smile:

Can you create a sample project?

I assume you have a formatting mask set on the textfield.

See ValidationMask in TextField.

2 Likes

As Christian says, it is likely you have a Validation Mask set on the text field. It is responsible for the “decorative” changes to the number format.