Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write text to text box instantly on button click event?

Status
Not open for further replies.

dmoonme

MIS
Jul 21, 2004
33
0
0
US
Hi, It seems simple enough but I can't figure it out. I would like to have "Please wait..." appear into a richtextbox immediately after Button1 is clicked. The code that I have displays "Please wait..." AFTER the subfunction is done.

Here's what I have so far.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 

[b]Me.RichTextBox1.Text = "Please wait..." [/b]
[b]'I WANT THIS TO APPEAR in RICHTEXTBOX1 WHEN BUTTON CLICKED [/b]
Me.RichTextBox1.Invalidate()

If OpenFileDialog1.FileNames.Length = 0 Then 
'checks if files have been selected 
    MessageBox.Show("Please select 1 or more files.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error) 
ElseIf DirectoryPathSaveToName = "" Then 
'checks if save to location has been set 
   MessageBox.Show("Please select ''Save To'' directory.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error) 
Else 
    LoadFiles(filesArray, DirectoryPathSaveToName) 
End If 

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top