Based on what you are saying, I’m going to make the assumption that you have some code in App.FileOpen which shows an Open dialog, creates a window and then loads the file into it.
Now, following that assumption, I am also assuming that you have not implemented the App.OpenDocument event to do the same exact thing (minus the open dialog)
Perhaps if you could show your code from both of these places?
var f as FolderItem
if f <> Nil Then
var NewWindow As new MainWindow
NewWindow.LoadData(f)
End If
LoadData contains
if f <> nil then
var UserSelect As TextInputStream
UserSelect = TextInputStream.Open(f)
UserSelect.Encoding = Encodings.UTF8
var ReadData As String
ReadData = UserSelect.ReadAll()
var NewWindow As new MainWindow
// -------------- TITLE BOX ----------------
NewWindow.TitleBox_1.Text = ReadData.NthField("field_divider", 1)
NewWindow.TitleBox_2.Text = ReadData.NthField("field_divider", 2)
NewWindow.TitleBox_3.Text = ReadData.NthField("field_divider", 3)
// -------------- TEXT BOX ----------------
NewWindow.TextBox_1.Text = ReadData.NthField("field_divider", 4)
NewWindow.TextBox_2.Text = ReadData.NthField("field_divider", 5)
NewWindow.TextBox_3.Text = ReadData.NthField("field_divider", 6)
NewWindow.Title="Note++ - "+f.Name
NewWindow.NameFile = f
UserSelect.Close
end if
Thank you.
Can you now put that code into the Application.OpenDocument event instead of the Window’s Opening event ?
If you want the Window to display something when it is opened, either you need to ask the user for the file (using your original code), or go get a file which you know the location of.