Question monitor text as it is input in textbox

Luckyluka1

Member
Joined
May 27, 2024
Messages
5
Programming Experience
1-3
Sorry, I don't have a code example because I don't know how to do what I am looking to do. I know how to check the TextBox.Text property to see if there is any text in there, but I want to be able to set the SaveToolStripButton.Enabled Property to True as soon as a user starts typing in the text box. I'm actually using Visual Basic 2022, but a lot of vb.net code works the same. Any help would be very appreciated.
 
As I have said elsewhere (after you had already made this post), you need to handle the TextChanged event of the TextBox. You can generate the handler by simply double-clicking the control in the designer, as you likely would have done to generate the Click event handler for that Button.
 
As I have said elsewhere (after you had already made this post), you need to handle the TextChanged event of the TextBox. You can generate the handler by simply double-clicking the control in the designer, as you likely would have done to generate the Click event handler for that Button
There is no TextChanged event with my TextBox. None that I can find anyway, not in my Visual Basic 2022.
 
At the other site, someone first assumed that you were using WPF, which was obviously incorrect because you mentioned a property that wouldn't exist if you were. I assumed that you were using Windows Forms, but you never actually confirmed that, which was good of you. Can you confirm now whether you are using Windows Forms or not and, if not, what you are using? If you are, have you double-clicked the TextBox in the designer, as I've told you twice you can do to generate a TextChanged event handler? What happened when you did that?
 
I do not know if I am using Windows Forms or not. I am looking into what it is now. I just found Windows Forms tutorial I am going to go read that now. But, besides that, I am using Visual Basic 2022, the free one that comes with the Visual Studio Community edition. In that Visual Basic, there is no TextChanged event that I can find. I'll go read the windows forms tutorial and I'll be back
 
What type of project did you create in the first place, i.e. which project template did you select? If you right-click the project in the Solution Explorer and click the Add menu item, is Windows Form one of the items you can add? Yet again, what happens of you double-click the TextBox in the designer?
 
OMG I feel so stupid. Sorry it took that much for you get across my this skull!! After finally double-clicking on the text box it takes me to the code window inside of, you guessed it, the TextBox.TextChanged even handler that I swore I did not have. I think I can figure it out from here. If not, I will be back with codes examples this time. Now that I have them. Thank you for hanging in there with me.

Private Sub TxtEditer_TextChanged(sender As Object, e As EventArgs) Handles TxtEditer.TextChanged

End Sub
 
As I have said elsewhere (after you had already made this post), you need to handle the TextChanged event of the TextBox. You can generate the handler by simply double-clicking the control in the designer, as you likely would have done to generate the Click event handler for that Button.

All I had to do was read. I feel so embarrassed. Hopefully this is a lesson learned. Read and re-read. My humblest apologies for my stupidity!
 
Mistakes are fine - we all make them - as long as we learn from them. As someone who has undoubtedly been stupid in the past, I say "all's well that ends well".
 

Latest posts

Back
Top