In an Extend method to the ListBox Control, I have this code that compiles but crash at run time with a NilObjectException.
The offending line is:
The_Left = List.Parent.Left
I tried:
The_Left = (List.Parent.Left)
and that failed too
Some minutes later after a glass of cold water
[code]Dim w As RectControl
w = List.Parent
The_Left = Str(w.Left)[/code]
I got the same crash.
Nota: w As Window
leads to an error at compile time:
Expected Window but got RectControl"
BTW: I want to get and store the window position / size at save file time to be able to restore it at load time.
Any idea of how to achieve that ?
BTW: fn-Delete
(OS X) does not works at that time. Once I really noticed that, I quit Xojo, reload it (double click on the project I was working on), click to open an event and click in the code editor: fn-Delete
works now.
I found a (bad) solution: use Window(0)
works, but this is bug prone because I may have another open window (a windoid or any other possible window).