Dim parentFolder As String
Dim subFolder As String = "/program files/folder1/folder2"
Dim di As New System.IO.DirectoryInfo(subFolder)
parentFolder = di.Parent.FullName '"/program files/folder1
'Delete this and all sub-directories of folder2...
you can define a class per form and then have the classes initialized in the main form. So form1 has a class called class1, form2 has class2 and so on. Use the reference to class1 in form1 and store any values in there - class1 is initialized in the main form and not in form1, form1 only uses...
I think this is what you want.
You can not close form as thats the thread from where you open form2 and 3. If you close form1, you simply exit the whole application!
So instead you should (as you have noticed) hide form1 and form2 or form3 will appear. When done, you show form1 from form2 and...
as answered, when you two different forms and you have a textbox or any other control with the same on each form, you won't have any problems as they reside in two different classes (i.e. for form1 and form2)
You could do something like this:
Public Structure CanvasPoint
Public X As Double
Public Y As Double
Public Class PointsReader
Public Shared Function ReadPoints(ByVal filePath As String) As CanvasPoint()...
An exception models an error in your program and not just that the user has not enetered a value. You should code-defesively i.e. check everything before using it. Never trust external data that it will be valid. Read more about exception handling in VB.NET.
Use the following code instead. I have tested the code it works.
To understand the different loops, visit VB.NET Loops
Dim Userinput As Decimal
Do Until (Userinput = 9)
Console.WriteLine("Select Product to order:")
Console.WriteLine("1. : $1")...
The following code is what you want. It retrieves the parent directory of filename.file and creates the parent directory if it does not exist. The code has been tested.
Dim parentDir As String
Dim fi As New FileInfo("C:\filepath\non-existant-directory\filename.file")...