Hi,
This new version of SAP Crystal reports have another issue with the focus event.
In some cases, the toolbar buttons are always disabled or in another cases when you minimize and maximize your window the toolbar buttons appear disabled.
You have two workarounds to this situation:
1º: Click on the buttons at the bottom of the viewer (size to fit, slider..), this will activate the toolbar buttons.
2º: insert this code in the window with the Crystal Reports viewer:
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
HwndSource source = PresentationSource.FromVisual(this) as HwndSource;
source.AddHook(WndProc);
}
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (MyReportViewer != null)
{
MyReportViewer.Focusable = true;
MyReportViewer.Focus();
}
return IntPtr.Zero;
}
In my case (minimize, maximize), this resolved the problem.
regards