Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have some VB windows forms and user controls which they inherit from some base classes like BaseUserControl and BaseForm, every behavior that I want them to have I'll just add it into the Base classes, Here is a problem, one project inside my solution is written in C# and the forms and user controls of this project they also inherit from those VB Base classes, but the functionalities that I add to the base classes will not be added to the C# classes,

It's my BaseUserControl,
VB.NET
Public Class BaseUserControl
    Inherits System.Windows.Forms.UserControl



    Protected Overrides Sub InitLayout()
        MyBase.InitLayout()
        If (Not handlerAdded) Then tryaddinghandler()
        TakeMenuEntranceDate()
    End Sub

End Class


It's one of my user controls,
VB.NET
Public Class AveHesab1
    Inherits Acc.WinUI.Common.BaseUserControl
'...
End Class


So far everything goes well and there is no problem.

Here is the problem,
C#
public class frmMoshakhasatPersonel : Acc.WinUI.Common.BaseUserControl
//...
End Class


The functionalities that I add into the BaseUserControl are added into the all VB user controls that inherit from it, but none of the C# user controls Get the behavior inserted into BaseUserControl.

Any help and idea to solve it is welcome,
Thanks,

What I have tried:

I'm still working on it but yet haven't found a solution.
Posted
Updated 20-Aug-16 21:56pm

1 solution

They do get the inheritance, but you have to rebuild the VB project first, or the C# code can't "see" the changes.
The C# dependency is on the DLL file it references, not on the source code for the project that creates the DLL - so that you can continue to work on the project while others reference your release version without any problems.
Just build the VB project, then check the C# - unless you are building the debug version and the C# code is referencing the release DLL, it will see it after that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900