iwdu15 wrote:
i tried that by this code:
Private Sub mnunew_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles mnunew.Click
Call NewForm()
End Sub
Private Sub NewForm()
Static intpages As Integer
intpages += 1
Dim frm As New Form1
frm.Text = "New Document" & intpages
FileDirectory = Nothing
frm.Show()
End Sub
filedirectory is just an uninvolved variable, but each time it creates a new
form it has the same thing "New Document1"
if you are doing it that way why not have a property that stores the
value...
Static mPageNumber As Integer
Private Sub mnunew_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles mnunew.Click
Call NewForm()
End Sub
Private Sub NewForm()
Dim frm As New Form1
mPageNumber += 1
frm.FormNumber = mPageNumber
FileDirectory = Nothing
frm.Show()
End Sub
public property FormNumber() as Intger
get
return mPageNumber
end get
set(value as integer)
mPageNumber = value
me.text = "New Document" & mPageNumber
end set
end property