Cant display image while requesting sql server 2000

bghanim

Active member
Joined
Dec 5, 2006
Messages
40
Location
Abu Dhabi - UAE
Programming Experience
1-3
Hi All,
I have a big problem with my application, I have a progress bar image (animated gif file), I need to show the image before I request the server and after a reply is received from the sql server, image should be invisible, but when I push the button to request the server, nothing happens i.e. the progress bar image is not displayed.

here is the code:
VB.NET:
me.pictureBox1.visible = true <<-----------
 
ipAddress = TextBox1.Text + "." + TextBox2.Text + "." + TextBox3.Text + "." + TextBox4.Text
mConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=clinic;Data Source=" + ipAddress
'Test Connection
Dim con As New OleDb.OleDbConnection
con.ConnectionString = mConnectionString
Try
con.Open()
con.Close()
MsgBox("Test Connection succeeded", , "result")
testFlag = True
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
 
me.pictureBox1.visible = false <<-----------

Please help me in this strange problem


Regards,
Baha
 
Last edited by a moderator:
Call Application.DoEvents.... what's happening is that the system doesn't get a chance to repaint the screen.... the DoEvents should allow that to happen

-tg
 
Thank you for your reply, I tried what you told me to do, the result was fine for displaying a still image. but as I said in my question, Im using an animated progess bar (gif format) and when I tried to use the application.DoEvents() the image was displayed but without being animated !!!


Can you help me to solve my problem..

Thank you in advance
Baha A. Ghanim
 
Last edited:
Back
Top