2 things: Show Form and .Net Framwork
I am currently developing an application with VB.NET. I just upgraded from VB6. I have 2 questions:
1) How do I open a form and only one instance of the form. For example, I am using the following code:
Dim frm as New frmMain
frm.Show()
This works fine but I only want the form to open once. If I click this button again, it opens another instance of the form.
2) When I package and deploy my applicaiton, are my users required to have XP or the .Net framework installed on their machines? Can I package and deploy a VB.Net application to run on a machine running Win95 or 98? Is the framework included in the installation of my packaged program?
Re: 2 things: Show Form and .Net Framwork
Quote:
Originally posted by ChrisMalter
I am currently developing an application with VB.NET. I just upgraded from VB6. I have 2 questions:
1) How do I open a form and only one instance of the form. For example, I am using the following code:
Dim frm as New frmMain
frm.Show()
This works fine but I only want the form to open once. If I click this button again, it opens another instance of the form.
2) When I package and deploy my applicaiton, are my users required to have XP or the .Net framework installed on their machines? Can I package and deploy a VB.Net application to run on a machine running Win95 or 98? Is the framework included in the installation of my packaged program?
1. Here is a solution thats even simpler:
Public Class SomeForm
...
...
Dim frm as new frmMain
public sub SomeProcedure()
frm.Show
end sub
end class
Now every time you call 'SomeProcedure', a new form wont be created.
2. What the last guy said.
.Net framework can be packaged
Yes, you can bundle the framework with a build. I have not had to try it since all the target servers have had .Net for running web services but I have read it is possible. You'll see a small circle and a line through it denoting the .Net framework is a dependency and not packaged in your MSI (setup project) by default.
When you view the build data of your app you should see a warning that the .Net framework is currently not part of the build and the target machines will require it to run this app. The name is given to you within the warning.