Question Need help associating Text box with buttons

vesterlee2008

New member
Joined
Feb 4, 2014
Messages
2
Programming Experience
Beginner
I am very new to this VB.NET and I am attending to school to learn but I am having some issues with trying to make things work as they should. I have to associate my text box with a button and it must display according to the information I have input. I understand that I must create a message box but how do I associate it to make it work ? Slide2.JPGSlide1.JPG
 
There is no association. When the user clicks a Button it will raise its Click event. You handle that event in your form to be able to perform some action when the user clicks the Button. That's the sum total of the Button's involvement. What action that you perform in that form is something separate and not actually anything to do with the Button because the code is in the form. If you want to display the text from a TextBox then that's exactly what you do, i.e. get the Text property of the desired TextBox and pass that when calling MessageBox.Show.

On a different note, I notice a serious bug in your code. In the Click event handler for your DoWhile Button you have:
Do While 1 < 5
As far as I'm aware, 1 will be less than 5 forever, so there's no exiting that loop. Clearly that's not the correct condition to be testing.
 
Ok it all sounds good in all, My thing is where do I write the code in order to make my text box work. May be I should be more clear. I need to type a letter in the text box and then one of the names I placed in the code will appear. My things is how do I write the code to make it do that? do I write in the one that says homework or do I write it in the one for textbox ?
 
I didn't even notice that box of information in with the code the first time around. It sounds like what you need is to use the auto-complete functionality already built into the TextBox. You should use the Help menu in your IDE to open the documentation for the TextBox class and read about those properties whose names start with AutoComplete and see if they satisfy your needs.
 
Back
Top