×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Splash Screen?

Splash Screen?

Splash Screen?

(OP)
My visio document executes a large amount of code at start up which causes a long load time. (30s-1m15s, depending on the system) and I was thinking it would be nice to add a splash screen to allow the user to see that the program is actually working and simply inform them that there is a long laod time.

 The problem is, the only way I know to do this is by adding a form and calling it. The problem with that is that the visio code does not execute while the focus is set on this form.

 Any ideas on what i can do?

RE: Splash Screen?

"The problem with that is that the visio code does not execute while the focus is set on this form."

If I understand you correctly, the form appears but the code doesn't execute until the form is closed? If so, you need to change the form's ShowModal property to False. Usually in VB6, Access, etc. this property is off by default, but in Visio, it's set by default.

With ShowModal = False, the following code should display the splash screen and run the loop at the same time.

CODE

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
Dim i As Integer

    Load UserForm1
    UserForm1.Show

    For i = 1 To 32766
        DoEvents
    Next

    MsgBox "done"
End Sub

RE: Splash Screen?

(OP)
I cant believe how difficult it is to make a splash screen in vba. :(

 I have the form loading and everything...the problem is that it wont actually load the forms graphics until all the code has run. It loads as directed. then shows itself. but it is nothing but a white form.

 then once my code has completed, my image shows up. What a headache. :(

RE: Splash Screen?

Yeah, I'm not a huge fan of VBA, but all languages have their idiosyncrasies. Java can be a pain too, especially with Swing GUIs. Too bad VBA wasn't more like VB6, or better yet, they could replace it altogether with VB.Net or C#.

As for the image on your form, I haven't tried to create a splash screen in VBA, but there's probably a way to load the image first. Did you call "Load Form" before calling "Form.Show"? If so, try placing the image loading code as the first part of your processing code. Make sure that if you're doing any fancy looping that you include DoEvents to allow other threads/processes to run while your code is off doing whatever it's doing. Finally, if all else fails, try loading the image in using a low-level API call... I think the Windows API has something for loading bitmap images.

RE: Splash Screen?

(OP)
I never did get this on figured out. :(

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close