Page 1 of 1

focus lost

Posted: 17 Jun 2013, 16:55
by roman
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

Re: focus lost

Posted: 26 Jun 2013, 14:31
by support
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.

Re: focus lost

Posted: 01 Jul 2013, 11:24
by roman
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

Re: focus lost

Posted: 01 Jul 2013, 12:18
by support
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.