Edit control balloon tooltip blanks Winforms controls (MFC/.net mi

G

Guest

Hi,
I have an MFC application that has a CDialog based dialog box that contains
a .net UserControl (via DDX_ManagedControl) as well as a native edit control
which has the ES_NUMBER style set. Now a very strange thing happens: If I
press a non-numeric key in the native edit control, up pops a little balloon
tip saying "Unacceptable Character", however when I press the key again, the
tooltip disappears, reappears and in the process blanks out all of the .Net
control. Any other native controls on the form are fine, just the .net
controls are blanking out and not repainting. If I move the mouse over them
they the do partially repaint.

Anyone come across this and know why it happens and if there is a solution?

(This can easily be reproduced in the "MFC04" sample .Net/MFC application
from MSDN.)
 
G

Gary Chang[MSFT]

Hi Aled,

I have performed some tests on this issue, I could repro this behavior on
my side.

Based on my research, It seems the .NET Winform control and MFC control
cannot work together within a template. Even if the tooltip balloon
doesn't occur, there is still has some problem while those two kind of
controls existed in a same dialog box window.

Currently, I don't find a solution on this issue. I will contact out
product team to look into this problem.


Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Gary Chang[MSFT]

Hi Aled,

Based on our research, we can workaround this painting issue by overriding
OnPaint in the UserControl to refresh itself. You also need a boolean to
make sure we don't call it recursively and get a stack overflow. Adding
the following code in WinFormUserControl1Control in the repro app will make
the issue go away.

private:
bool painting;

protected:

virtual void OnPaint(System::Windows::Forms::paintEventArgs^ e)
override
{
if (painting)
return;

painting = true;
this->Refresh();
painting = false;
}


Wish this helps!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top