Visible Property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!
I have an event with this code:
picture1.Visible = True
Lbl_Waiting.Visible = True
' Beginning the query to populate the List
List1.RowSourceType = "Table/Query"
List1.RowSource = "Q2"
List1.ColumnWidths = "2000;900;3000"
List1.Enabled = True
' End
picture1.Visible = False
Lbl_Waiting.Visible = False

This two objects never apears on run-time. It seams that the property
'Visible' only works after the query done.
What I want is a picture of a clock to be visible when the query is being
made.

Can someone help?
 
Try and use the DoEvents after each comand
picture1.Visible = True
DoEvents
Lbl_Waiting.Visible = True
DoEvents
 
Nuno Guerra said:
Hi!
I have an event with this code:
picture1.Visible = True
Lbl_Waiting.Visible = True
' Beginning the query to populate the List
List1.RowSourceType = "Table/Query"
List1.RowSource = "Q2"
List1.ColumnWidths = "2000;900;3000"
List1.Enabled = True
' End
picture1.Visible = False
Lbl_Waiting.Visible = False

This two objects never apears on run-time. It seams that the property
'Visible' only works after the query done.
What I want is a picture of a clock to be visible when the query is
being made.

Can someone help?

You may need something like this:

Dim lngCount As Long

picture1.Visible = True
Lbl_Waiting.Visible = True
DoEvents
Me.Repaint
' Beginning the query to populate the List
With List1
.RowSourceType = "Table/Query"
.RowSource = "Q2"
.ColumnWidths = "2000;900;3000"
.Enabled = True
lngCount = .ListCount ' force complete population
End With
' End
picture1.Visible = False
Lbl_Waiting.Visible = False
'** PROBABLY DON'T NEED THESE 2 LINES HERE:
'DoEvents
'Me.Repaint
 
Nuno said:
I have an event with this code:
picture1.Visible = True
Lbl_Waiting.Visible = True
' Beginning the query to populate the List
List1.RowSourceType = "Table/Query"
List1.RowSource = "Q2"
List1.ColumnWidths = "2000;900;3000"
List1.Enabled = True
' End
picture1.Visible = False
Lbl_Waiting.Visible = False

This two objects never apears on run-time. It seams that the property
'Visible' only works after the query done.
What I want is a picture of a clock to be visible when the query is being
made.


The screen updating is done as a background activity
compared to code execution.

Try using:
Me.Repaint
after making the two controls visible.

You may or may not need to do it again after making them
invisible.

It's also possible that you may need to add one or two
DoEvents after the Repaint.
 
It works!
Thanks a lot!

Ofer said:
Try and use the DoEvents after each comand
picture1.Visible = True
DoEvents
Lbl_Waiting.Visible = True
DoEvents
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck
 
Back
Top