Author Topic: AcFocusCtrl - again  (Read 2919 times)

0 Members and 1 Guest are viewing this topic.

jbuzbee

  • Swamp Rat
  • Posts: 851
AcFocusCtrl - again
« on: June 08, 2006, 04:34:50 PM »
I want to simulate a tollbar button on a modeless form:

Private Sub MtextSm_Click()
ThisDrawing.SendCommand "mtext" & vbCr
End Sub

The only problem is you have to click in the drawing window to force control away from the modeless form to the drawing.  There seems to be an activate method but I can't find any info about it:

AcFocusCtrl1.SetFocus  . . .

Any ideas??

Thanks, jb
James Buzbee
Windows 8

Bob Wahr

  • Guest
Re: AcFocusCtrl - again
« Reply #1 on: June 09, 2006, 10:43:13 AM »
I tried it in 2006 and it worked fine.  I had to click on the autocad window as part of the mtext command but it didn't require an additional click to activate autocad first.

You would use setfocus if you wanted to set the focus to say a textbox on your form when the button was clicked.

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: AcFocusCtrl - again
« Reply #2 on: June 09, 2006, 01:04:18 PM »
Really?  This is from a Modeless form that doesn't get hidden - stays visible.  The sequence is 1) "Click" the button on the form - now I can see the textjig and Mtext asking for the first point: 2) Now "Click" in the Drawing window to switch focus from the modeless form, and 3) "Click" to select the first point of the mtext window.   That's 3 clicks for me and only 2 for you?  I wonder what I'm doing different???

jb
James Buzbee
Windows 8

Bob Wahr

  • Guest
Re: AcFocusCtrl - again
« Reply #3 on: June 09, 2006, 01:08:08 PM »
what version of autocad are you using?

Our forms were different.  Mine was a simple one button non-modal userform.  I'm guessing yours has more going on.