RE: Delegate for control embedded into MFC
- From: v-lliu@xxxxxxxxxxxxxxxxxxxx (Linda Liu [MSFT])
- Date: Mon, 09 Jul 2007 07:28:20 GMT
Hi,
Based on my understanding, you have a managed Visual C++ Windows Forms
Control Library project and a UserControl in this project. You add the
UserControl on a form within a C# WinForms application project. You want to
add a CWnd object to the UserControl and use CWinFormsControl class to
embed a Button into the CWnd object. Then you'd like to register the Click
event of the Button in the form within the C# project. If I'm off base,
please feel free to let me know.
In my opinion, to register the Click event of the Button in C# project, you
only need to use the += operator, just like you do with the simple scenario
you mentioned at the beginning of your post.
I notice that your sample method 'CreateControl' create a new control,
which may conduct that the actual Button control shown in the CWnd object
is not the one that you're attempting to add into the CWnd. Maybe this is
the reason why the btn_Click handler isn't invoked in your project.
If the problem is still not resolved, you may send me a simple project that
could just reproduce the problem. To get my actual email address, remove
'online' from my displayed email address.
Sincerely,
Linda Liu
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.
.
- Follow-Ups:
- RE: Delegate for control embedded into MFC
- From: bmelt
- RE: Delegate for control embedded into MFC
- Prev by Date: RE: Column will not consistently hide in DataGridView when on a TabPage. Bug?
- Next by Date: ScrollableControl no automatic scrolling
- Previous by thread: RE: Can 2 TreeView controls share a single image collection?
- Next by thread: RE: Delegate for control embedded into MFC
- Index(es):
Loading