These seem like great functions to help user interactions, but the best I could manage so far was a very specifically sized and colored text box
'Gotta have some shape set as SDim Test As New OnScreenText Test.SetTextAndPosition "This is the bad shape!", S.CenterX, S.CenterY Test.SetTextColor (RGB(255, 0, 0)) Test.Show
The SetTextColor command did nothing (I may be using the wrong colort type, but there was no error message). The font is fairly specific and small.
Is there more information or examples of these functions anywhere? Ideally I would like to draw a box around corrupt shapes, for example. Or even better an outline to the shape, etc.
But how?
Color dont change
Joe said:Well, there are no error messages, but there are zero changes anywhere either.
Joe said:Am I doing something wrong or is this functionality just half baked?
My experience with OnScreenCurve is limited to using rectangles, e.g., in my Weed Box macro, to show where the box is going to be created.
That uses OnScreenCurve.SetRectangle.
As a test, you might try that to see if you can successfully create and show an OnScreenCurve, set the pen properties, etc.
Edited to add:
I just tried testing this myself, and it's not working for me with .SetRectangle, either.
I may have to look back at my Weed Box macro and see what I did differently there (where it is working).
OK, this seems to work, as a simple demo of using an OnScreenCurve based on a selected shape:
Option Explicit Dim OSC_1 As OnScreenCurve Sub onscreencurve_test_1() Dim lngOSCOutlineColor As Long Const lngOSCOutlineWidthPixels As Long = 3 Dim s As Shape lngOSCOutlineColor = RGB(255, 0, 0) Set s = ActiveShape Set OSC_1 = Application.CreateOnScreenCurve OSC_1.SetCurve s.DisplayCurve OSC_1.Show OSC_1.SetPen lngOSCOutlineColor, lngOSCOutlineWidthPixels, cdrOnScreenCurvePenDash Refresh End Sub
Really strange... it works when I step through it (F8), but not when it's run the regular way (F5).
But at least it looks correct, so huge thanks for that. Now onto more research.
I'm on CorelDRAW 2018, just in case.
Edit: Actually, my main intent for this was error display, and when a MsgBox pops up all works just fine. Still, would be neat to have it as stable as in your example video.
Thanks. This in combination with adding something to delay screen refresh (like a MsgBox) will work great.