if you mean vb as in vb 6.0 then you can use these in C# but adding it as a reference...selecting reference in your solution right click and select the appropriate ocx or dll or right click on your toolbox and you can add a reference that way.
It should work fine as long as:
- Don't use operator overloading (VB.NET doesn't have it)
- Don't use case-sensitive names (in C#, firstName and FirstName are different, in VB.NET they'd be regarded as the same method)
- Don't expose any custom attributes, or expect your control's users to use custom attributes (VB.NET doesn't have them)
But usercontrols are project specific... and projects are language specific.
You could use a server control written in vb w/ a c# web project, but I don't think you can use a user control, since it's tied to the particular project.
If you create a "Control Library" project in Visual Studio, you can use the C# controls in VB projects transparently.
This presumes that you have created a User Control. This can be done for both Windows Forms and for Web Pages.
Once you have a Control Library you can use it in a VB or C# project in several ways. But particularly you can add the User Control to the Tools menu and use it like any other .NET control (Right click Tools menu, Customize..., add the Control Library)
VB controls can be used in C# projects & vice versa.
I realize it's just semantics, but a user control cannot be added to the toolbox, and is tied to a project (and therefore a language) for web projects. I can't speak to windows forms projects.
I think what you're referring to are custom server controls. Those can be added to the toolbox and created in any .NET language, and are created by making a new "Control Library" project.
Possibly semantics as you say. I think we are in violent agreement. In either case, you are correct that a user control in a "regular" project cannot be added to the tools menu.
For Windows forms, a UserControl object in a Control Library Project can be added to the tools menu. The Control Library project can also be added to another solution. ---
dino
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.