Clearing a TextBox

D

Drew Leon

I have a Form with a Tab Control on it. Each of the Tabs have two List Boxes
on them. When you Select an Item from the List Box, the Text Box at the
bottom of the Form gets populated. I would like to have the Text Box clear
itself when I switch Tabs. Any assistance would be greatly appreciated.
Thank you, Drew Leon.
 
M

Mark

Is this what you are wanting?

Private Sub TabControl1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged

TextBox1.Text = ""

End Sub
 
D

Drew Leon

Thanks Mark, but I want the text box to clear itself when I switch tabs. I
think it has something to do with the tab click event, but I'm not sure.


Mark said:
Is this what you are wanting?

Private Sub TabControl1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
TabControl1.SelectedIndexChanged

TextBox1.Text = ""

End Sub
 
C

Cor Ligthert [MVP]

Drew,

I could have helped you, however I have seen that you have so much spoiled
this newsgroup about this problem, that I don't do it. I think that somebody
else does it in another message.

I know that I am not the only one who have this policy, however this message
to let you know why.

Cor
 
D

Drew Leon

Cor,

My intention is certainly not to "spoil" YOUR newsgroup, however, the first
time I sent this message, I received answers which did not assist me. The
second time I sent the message, the message text did not make it to the
newsgroup (It was an empty message), which would have made it hard for
others to understand the problem I was having (unless they received the
message via Osmosis). The third, and final time I sent this message, I
didn't recieve an answer which helped me, other than your very elequently
worded post. Thank you for your reply. Your answer has assisted me in my
quest to begin Visual Basic as a hobby. Have a great day, Drew Leon.

P.S. If you ever have a question I can assist you with, please feel free to
ask. I will research it until I get you a good answer.
 
C

Cor Ligthert [MVP]

Drew,

If you sent complaints to this newsgroup tell than the truth it were not 3
but 5 messages in I thought one hour from which 2 where different.

From one I thought what he wants only a header, there are people who do
that, but that can happen that there is than another message sent, no
problem.

In first that I have read I have replied on Hals question not yours. Hal had
already given the correct answer.

One I have answered, however there was very few information so I did the
best I could do.

After reading some messages from others, came the real text from your
question, although it was as well not completely clear, at this moment it is
still after 15 hours unanswered what is very unusual in this newsgroup.

Than came this message obviously the real question that Hal would have
answered in another way if he had seen it and wrote the previous message. I
then wrote my message. There could have been more after that from you which
I would obviously than not have answered.

However I did only try to help you, because more people will act like me
when they have readed questions, tryed to understand themn and see than in
the fifth one that is earlier sent the real problem

That is not about this newsgroup that is in every newsgroup.

However do as you want, it was only an advice.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top