I have an initial window called "Main" this window is created in Visual Studio 2015 in C #, and another one called "Secondary" also created in visual Studio 2015 but in VB, both windows are within the same project.
In the "Main" window there is a button, which will open the "Secondary" window and close the "Main" window at the same time, this action is executed under the following instruction: (This instruction is in C # and what you will do is go from the "Main" window to the "Secondary" window)
private void ButtonIr_Click(object sender, EventArgs e)
{
Secundaria s = new Secundaria();
s.Visible = true;
this.Dispose(false);
}
While in the "Secondary" window there is another button called Back, the function of this button will be to carry from the "Secondary" window to the "Main" window, and close the Secondary window at that same instant in time, the problem is that VB does not recognize the reference of the "Main" window as it did in C # when I entered the code to go to the "Secondary" window from the "Main" window; I tried to use this instruction: (but I did not find it useful to return to the "Main" window even if it works to take you to a new window)
Private Sub ButtonVolver_Click(sender As Object, e As EventArgs) Handles ButtonVolver.Click
Dim p As New Principal()
p.Show()
Dispose(False)
End Sub
It should be noted that the project in general the first window created was the "Main" window in C # and then the project in VB was added to the "Secondary" window, I do not know if that directly influences the references or if it does not matter for nothing.
If someone knows what I'm doing wrong or what instruction I need to declare in VB so that I recognize the reference of the main window would be very useful, and thanks in advance.