focus lost

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
roman
Posts: 43
Joined: 11 Aug 2011, 11:43

focus lost

Post by roman » 17 Jun 2013, 16:55

Hello,

I'm using the CadEditorControl and I got a textbox for text input. When the textbox has it's focus to write text and the mouse is put on the cadPictureBox of the EditorControl the fokus is transferred to the cadPictureBox.
This occurs after the cadEditorControl1.CreateNewImage() is called. When the createNewImage method is not called everything is as expected.

How can I keep the focus inside the textbox.
Thank you Roman

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: focus lost

Post by support » 26 Jun 2013, 14:31

Hello Roman.
CADEditorControl inner event handler for control's MouseMove event includes calling Focus for the control. You can Focus to a required control instead:

Code: Select all

private void InitializeComponent()
{
    ...
    this.cadEditorControl.PictureBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.cadPictBox_MouseMove);
    ...
}
...
private void cadPictBox_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
    this.textBox1.Focus();
}
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

roman
Posts: 43
Joined: 11 Aug 2011, 11:43

Re: focus lost

Post by roman » 01 Jul 2013, 11:24

Hi,
is there a way to disable the inner event handler which pulls the focus?
I have to check which control hat the focus before, but in the event described before i only get the CADPictudeBox as previous focused control...

Thank you,
Roman

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: focus lost

Post by support » 01 Jul 2013, 12:18

Hello Roman.
Unfortunately inner event handling for CADEditorControl can't be disabled. The event handlers can be modified if CADPictureBox control used only. CADPictureBox event handling realized outside the library. The example can be found in Viewer demo project.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply