OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 10-03-2004, 11:00
Rick Randall
Posts: n/a
Default An informational message box that doesn't stop the app?

I have a macro and want to display an informational message box that updates the user on what the macro is doing at that time. My problem is, every message box stops the app and waits for the user to click ok before it resumes. I just need one without any buttons that is for info only.

How is this done?
Reply With Quote
Old 15-03-2004, 09:04
Posts: n/a
Default RE: An informational message box that doesn't stop the app?

how about showing a form?



Reply With Quote
Old 15-03-2004, 10:38
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: RE: An informational message box that doesn't stop the a

Just showing a form won't work because this will stall your main process until the form is closed.

VBA cannot show a modeless form if there is a modal form displayed. That's another limitation.

What can be done, however, is to show a form and do the actual processing in that form and update the form with the progress.

So, you show your main form, take the user's input, then when OK is pressed show another form. Or it's even easier to just show a progress bar/status message in your main form while the processing goes on. I used this approach in a few of my own macros like Calendar Wizard or Function Plotter. You might have noticed that there is a status bar at the bottom of the macros' forms and it will show the progress as the macro goes about its stuff.

Yet another solution for CorelDRAW 12 is to use the new AppStatus class which can utilize CorelDRAW's status bar and its progress meter.

Here is an example which shows how to display the macro's progress in CorelDRAW's status bar:

Sub ShowProgress()
    Dim doc As Document
    Dim n As Long
    Dim stat As AppStatus
    Set stat = Application.Status
    Set doc = CreateDocument
    stat.BeginProgress CanAbort:=True
    For n = 1 To 1000
        doc.ActiveLayer.CreateRectangle2 Rnd() * 8, Rnd() * 11, Rnd() * 5, Rnd() * 5
        If (n Mod 10) = 0 Then
            If stat.Aborted Then Exit For
        End If
    Next n
End Sub
The above rectangle creates 1000 rectangles in a new document. You can see a progress bar going in the status bar. You can press Esc to abort the operation.

I hope this helps.
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Unexpected condition" error message (with code) s_federici CorelDRAW/Corel DESIGNER VBA 10 10-07-2003 21:46
takes Draw a long time to start a new document! bbolte CorelDRAW/Corel DESIGNER VBA 5 14-05-2003 09:09

All times are GMT -5. The time now is 05:50.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com