OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > Code Critique

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-11-2010, 11:48
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default better way to resort to previous tool after zooming

Hi.
Assign macro shortcut shift z
Run with shift z and hit esc to return to previous tool, or wait 3 seconds to go back to previous tool automatically.
If previous tool was already zoom tool then macro resorts to pick tool.
You can change seconds value in macro (search for 3 in code).


Code:
Option Explicit

Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

Sub quickZoom()
    Dim t As Integer
    Dim sngStartTime As Single
    sngStartTime = Timer
   
    t = ActiveTool
    If ActiveTool <> cdrToolZoom Then
            ActiveTool = cdrToolZoom
        End If
    Do While GetAsyncKeyState(vbKeyEscape) = 0 And (Timer - sngStartTime) < 3
        DoEvents
    Loop
    If t = cdrToolZoom Then
        ActiveTool = cdrToolPick
    Else
        ActiveTool = t
    End If
End Sub
Anyone have a better way?
-John
Reply With Quote
Reply

Tags
previous tool, zoom tool


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
Previous view vindaa CorelDRAW/Corel DESIGNER VBA 4 16-05-2012 02:39
how to resume previous state of control after mouse move event aakkaarr CorelDRAW/Corel DESIGNER VBA 4 23-02-2010 14:06
selecting a different tool with VBA Rick Randall CorelDRAW/Corel DESIGNER VBA 7 09-10-2009 14:50
New Tool Hernán New product ideas 2 24-02-2004 16:08
How can I use eraser tool through VBA nagasuresh CorelDRAW/Corel DESIGNER VBA 1 12-02-2004 13:48


All times are GMT -5. The time now is 13:25.


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