OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 16-08-2013, 05:47
Harry Harry is offline
Join Date: Apr 2007
Location: London UK
Posts: 58
Default Showing and hiding a user form

I have a form, which I can show and hide using userform1.show and userform1.hide.

The problem is that userform1.show causes the user form to take focus -- so that, for example, I can no longer alt-tab between open document windows or use any keyboard shortcuts.

I thought I could do this by userform1.visible = true but this gives a runtime error "function or interface marked as restricted".

So, any suggestions for displaying a form without it taking focus -- or of making it hand focus back to the document immediately afterwards.
Reply With Quote
Old 20-08-2013, 05:54
basti.schneider basti.schneider is offline
Junior Member
Join Date: Apr 2010
Posts: 8
Default Workaround

I had the same problem yesterday.
I don't have a solution, but a workaround.
I inserted

Application.AppWindow.WindowState = cdrWindowMaximized

into my source code to get the focus back to CorelDraw.
This is neither nice nor fast.

I hope that someone comes up with a better solution!
Reply With Quote
Old 20-08-2013, 15:29
Harry Harry is offline
Join Date: Apr 2007
Location: London UK
Posts: 58

Thanks ... that will do for the moment.
Reply With Quote
Old 21-08-2013, 06:22
Joe Joe is offline
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe

Interesting question... So I googled it and found this really simple solution - just add

AppActivate "CorelDRAW"
at the end of your form show code.
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
Help with User Form katruax CorelDRAW/Corel DESIGNER VBA 1 02-05-2012 02:26
User form Freeze 0meg@ CorelDRAW/Corel DESIGNER VBA 1 10-12-2010 12:36
Add a hyperlink in a User form PAnderson CorelDRAW/Corel DESIGNER VBA 4 15-08-2010 20:54
hiding/showing single shapes andrewf CorelDRAW/Corel DESIGNER VBA 7 03-02-2010 02:01
[Newbie] User Form Revisited Booker CorelDRAW/Corel DESIGNER VBA 1 16-12-2005 21:08

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

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