Hi Lance,
I performed a test based on your description and did see the problem on my
side.
In fact, there're many limitations when a form is shown within a control.
For example, if the form has a TextBox on it, and the form is shown within
a control, say a Panel, you'll see that you can't set the input caret in
the TextBox when you click in the TextBox.
Your problem is another limitation related to this topic. A workaround of
your problem is to handle the Panel's SizeChanged event and in the event
handler, hide the form and then show the from as a maximized window to
force the form to repaint itself.
The following is the sample code.
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
extern static bool ShowWindow(IntPtr hWnd,int nCmdShow);
int SW_MAXIMIZE = 3;
int SW_HIDE = 0;
void panel1_SizeChanged(object sender, EventArgs e)
{
this.SuspendLayout();
// the 'frm' is the form that is shown within a Panel
ShowWindow(frm.Handle, SW_HIDE );
ShowWindow(frm.Handle, SW_MAXIMIZE);
this.ResumeLayout();
}
Hope this helps.
If you have any question, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.