How can I run code in a background thread and still access the UI?

While I’m glad you found a solution, I advise against using Application.DoEvents() because it is bad practice. Please see this blog post: Keeping your UI Responsive and the Dangers of Application.DoEvents. Simply put, Application.DoEvents() is a dirty workaround that makes your UI seem responsive because it forces the UI thread to handle all currently available … Read more

VB If statement AND/OR

for simple .. use SELECT CASE Private Sub txtchange_Change() Select case Ucase(txtchange.Text) case “A” : lbloutput.Caption = “Apple” case “B” : lbloutput.Caption = “Banana” case “C” : lbloutput.Caption = “Cat” case “D” : lbloutput.Caption = “Dog” case “RED” : lbloutput.BackColor = RGB(255, 0, 0) case Else lbloutput.Caption = “Not Found” End Select End Sub