Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27034

Select GotFocus and LostFocus

$
0
0
Hi there,

I am new to Visual Basic and to the Forums. I have been working on an assignment for my class, and there is one problem I have been encountering. I am trying to figure out how to set a yellow background color when the focus is on a Textbox, and have it set back to white, when the focus is no longer on it. So far, here is the coding I have tried, but nothing has really worked.

Here is the code:

Private Sub txtAdultPricePerTicket_GotFocus()
txtAdultPricePerTicket.BackColor = Color.Yellow
End Sub

Private Sub txtAdultPricePerTicket_LostFocus()
txtAdultTicketsSold.BackColor = Color.White
End Sub


Can someone tell me what I am doing wrong?

Viewing all articles
Browse latest Browse all 27034

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>