OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 16-08-2013, 04:47
Harry Harry is offline
Member
 
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
  #2  
Old 20-08-2013, 04: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.Activate
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
  #3  
Old 20-08-2013, 14:29
Harry Harry is offline
Member
 
Join Date: Apr 2007
Location: London UK
Posts: 58
Default

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

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

Code:
AppActivate "CorelDRAW"
at the end of your form show code.
Reply With Quote
Reply


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 01:26
User form Freeze 0meg@ CorelDRAW/Corel DESIGNER VBA 1 10-12-2010 11:36
Add a hyperlink in a User form PAnderson CorelDRAW/Corel DESIGNER VBA 4 15-08-2010 19:54
hiding/showing single shapes andrewf CorelDRAW/Corel DESIGNER VBA 7 03-02-2010 01:01
[Newbie] User Form Revisited Booker CorelDRAW/Corel DESIGNER VBA 1 16-12-2005 20:08


All times are GMT -5. The time now is 10:30.


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