![]() |
#1
|
|||
|
|||
![]()
Hello, I have a modeless box containing a text field I'd like it so that after a number is entered into the textbox and enter is pressed control is returned to the main CorelDraw application (I'm using version 12). This is the code I have for the text box (named mmMove):
Code:
Private Sub mmMove_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case Asc("0") To Asc("9") Case Asc(13) BringWindowToTop AppWindow.Handle Case Else KeyAscii = 0 BringWindowToTop AppWindow.Handle End Select End Sub Thanks, Chris (Hunt) |
#2
|
|||
|
|||
![]()
Don't use VBA that much, but did you try the API SetActiveWindow? Is KeyAscii returned as 13 on KeyPress? I had some problems with this in X4 (Never did in 12), but got around them by displaying dialogs via the API instead of using VB 6's .Show.
|
#3
|
|||
|
|||
![]()
Thanks for the reply. I don't know anything about API SetActiveWindow. How can I use it?
Chris |
#4
|
||||
|
||||
![]()
You shouldn't be using Asc(13). 13 is already a character code. If you do this, VBA would convert your number 13 into a string "13" and then get the character code of the first letter "1".
You should just put Code:
Case 13 ... |
#5
|
|||
|
|||
![]()
Hi Alex, I tried that but it doesn't work. Perhaps something is wonky with my installation.
Chris |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Passing Control From Modeless Forms | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 2 | 01-04-2007 10:21 |