frmMyForm would be the default instance. That may be the right one, but from your description, probably not. If it isn't the right one, you definitely wouldn't want to use it.
Sorry, I am new at this forum. This is the only code that I have. After Me. there are many options starting from Adapter to XSelectPath. The closest to what I want to do is Hide. But I simply want to close or hide the form.
Code:
Protected Sub btnClose_Click(sender As Object, e As System.EventArgs) Handles btnClose.Click
Me. (nothing applies here)
End Sub
After staring real hard at the pic you posted it looks like this is in a Partial Class. You can't you Me to represent the Form object like that. Why isn't the Button Click Event inside the Form object. If you move it there then it will work.
Most forms are partial classes, so that's not totally out of the question. Generally, it is the .designer.vb that gets the Partial Class designation, but it doesn't HAVE to be that way.
What does have to be the case is that it has to be at least part of a form class, but it would have to be for that button to work...in most cases. I'm intrigued by the use of Protected on that method. It's not necessarily right or wrong, but does suggest that this is part of some kind of novel inheritance tree. It doesn't sound like it is necessarily a form, but it might be something derived from a form in some fashion, so you might be able to get away with MyBase.Close, though if that worked, it would be best if you understood why, and I certainly don't from what has been shown thus far.
The forum software tends to shrink screenshots down to the point where they become unreadable, so pasting code, as you did, is FAR better when showing code. Screenshots of forms are a different matter, but code doesn't work well as a screenshot.
I think that you have failed to provide some very important information. I enlarged your screenshot and, despite everything being very fuzzy, it appeared that your class inherits System.Web.UI.Page, which means that you are dealing with a page in a Web Forms app and not a form in Windows Forms app. The two are very different.
If, instead of lazily copying your whole screen, including all that empty space, you had copied just the small part with the code in it, we would have been able to see that easily in the first place. New or not, you can still consider the fact that it's pointless posting a huge image with loads of empty space when all you need is a small pit of code. You appear to be using Windows 10 and both the Snipping Tool and Snip & Sketch enable you to easily copy a small portion of the screen in moments. If you'd like us to volunteer our time to helo you, the least you can do is take the time to make doing so as easy as possible.
Sorry about the whole screen shot. It was not being lazy. I actually spent about a half hour trying to capture the list of options, but it closed every time I opened my screenshot software. Since, I did figure out how to preset an area so this might have worked. I do not see it here however, so if 175637 is not a screen shot, please do not waste your time with this. There is nothing new in it. Me.Close does not seem to be an option although everything that I have searched says it should be. Thank you for your help.
Me.Close does not seem to be an option although everything that I have searched says it should be.
Then your research has all been a waste of time. Are you trying to create a Windows application or a web application? What you have there is a web application. The Page class has no Close method, as the documentation clear indicates:
You can have a web page close the browser tab/window it is displayed in but that would be done in JavaScript on the client, not on the server. How would hiding a web page work?
I think that you must want a Windows app, which means that you can ditch that project altogether and create a new one of the correct type. If you actually do want a web app then you need to learn how they work, because it appears that you have been researching Windows apps.
Thank you jmcihinney, you gave me the answer. I was opening the form as a popup using JavaScript.
Code:
Dim url As String = "Income.aspx"
Dim s As String = "window.open('" & url + "', 'popup_window', 'width=800,height=800,left=100,top=100,resizable=yes');"
ClientScript.RegisterStartupScript(Me.GetType(), "script", s, True)
I needed to use JavaScript to close it.
Code:
Dim s As String = "window.close('" & url + "',');"
ClientScript.RegisterStartupScript(Me.GetType(), "script", s, True)
This does not actually close it, but it hides it. So, that is a start.