.NET

Reply
Valued Contributor
dynamicscope
Posts: 95
Registered: ‎04-04-2012
Message 1 of 3 (360 Views)
Accepted Solution

Prompt message issue with a modeless dialog

360 Views, 2 Replies
09-27-2012 11:26 PM

Base: Object ARX 2010

Language: C# (.NET Frame 3.5)

 

Hi,

 

I made a modeless dialog  (WinForm) to use as a toolbar. The dialog has a button that "Prompt Entity" from the drawing.

 

ex)

PromptEntityOptions peo = new PromptEntityOption("Select Entity:");

PromptEntityResult per = ed.GetEntity(peo);

 

But this function is not wokring as I intended. When I click this button, the prompt message (message that sticks on the mouse cursor) does not show up immediately.

 

The message appears when I click the drawing window twice.

 

This behavior is not good since the user would not know if the button is clicked properly. (if the prompt message does not show up immediately.)

 

It seems like a focus (window) issue to me.

 

How could I solve this issue?

Any idea?

 

Regards,

 

Jake

 

Valued Contributor
bojko108
Posts: 61
Registered: ‎01-23-2011
Message 2 of 3 (344 Views)

Re: Prompt message issue with a modeless dialog

09-28-2012 03:40 AM in reply to: dynamicscope

I saw this in one other topic. Try to use Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView()

Distinguished Contributor
Irvin
Posts: 112
Registered: ‎04-22-2009
Message 3 of 3 (338 Views)

Re: Prompt message issue with a modeless dialog

09-28-2012 04:48 AM in reply to: dynamicscope

There are other Methods than using the setfocus to dwg:

 

Look at the next snipped:

 

private void btnPickPoint_Click(object sender, EventArgs e)
        {
            using (EditorUserInteraction edUsrInt = ed.StartUserInteraction(this))
            {
                // Code to select a point
PromptPointOptions prPtOpts = new PromptPointOptions("\nSpecify insertion base point:"); PromptPointResult prPtRes = ed.GetPoint(prPtOpts); _point = prPtRes.Value; tbX.Text = _point.X.ToString(); tbY.Text = _point.Y.ToString(); tbZ.Text = _point.Z.ToString(); // End the UserInteraction. edUsrInt.End(); //this.Focus(); } }

 Hope this will help!

 

Irvin

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community