Outlook loses mail body focus

Add-in Express™ Support Service
That's what is more important than anything else

Outlook loses mail body focus
 
Reggie




Posts: 12
Joined: 2022-03-22
Hello,

I have a problem when I compose a new mail in outlook. It seems that the focus goes to my ADXRegion instead of staying on the mail body.

The scenario I want is when I compose a new mail, the cursor stays in the mail body. If I hide the regions, then it works as normal so the problem is the regions.

I hope you can help me with this issue!

Kind regards,

Reggie
Posted 08 Nov, 2022 05:42:01 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Reggie,

What layout do you use to show the ADXOlForm?

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 08 Nov, 2022 06:06:58 Top
Reggie




Posts: 12
Joined: 2022-03-22
Hello Andrei,

We use CurrentInstance.Items[0].GetCurrentForm()).Visible = true; in C# to make the Rightpanel visible.
The layout is a usercontrol in WPF.
As soon as the Rightpanel is shown, the active mail item body will lose focus so it looks to me as the region is getting the focus.

Kind regards,

Reggie
Posted 08 Nov, 2022 06:17:18 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Reggie,

If the region is showed, the focus goes to the region; this is expected. If you need to have the focus in the email body, you should use Windows API to find the window corresponding to the email body and call the SetFocus function. You should do this after the region is shown; use System.Windows.Forms.Timer to set the focus.

Regards from Poland (GMT+1),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Nov, 2022 04:03:26 Top