-4
If you want to include the file Loading.cs
in its Visual Basic project, that is not possible. Compilers handle only one language type in the same project. You will have to rewrite the C# code in your VB.Net project.
Alternatively, you can reference the project in C# in your VB.Net and use the content of the other project in your.
For this, refer the C# project to the Visual Basic project and install the class of the other project in your:
Imports <caminho.para.sua.form> ' aqui é o namespace de onde sua classe Loading está
...
Dim janela As New Loading
janela.Show()
Remark: the class
Loading
must be public (public
) for the other project to access it.
But as I refer a project to another?
- Within the VB.NET project, right-click on references:
- Select your project in C# in the "Projects tab":
- Click OK.
You have given the following error https://imgur.com/43qaXUU I have left the public loading class
– PcakBadoor
@C0DE replaces the
<Loading>
by the way (namespace) from where your classLoading
is.– CypherPotato
I don’t understand could you tell me an example
– PcakBadoor
@C0DE
Imports NomeDoProjeto.Janelas
, insideJanelas
has the classLoading
.– CypherPotato
It appears that it is giving error https://imgur.com/K522X1N https://imgur.com/zm8bOUr
– PcakBadoor
In the
Loading.janelas
you need to replace with the class namespaceLoading
. In your question, you do not specify the namespace. But what is a Namespace?– CypherPotato
https://imgur.com/GwwlyJd My namespace and that
– PcakBadoor