Okay, I've tried searching for this, but can't find an answer that works for 
me. I'm updating an old project with four forms, and one of them has a grid. 
When I run it with the default form designer code, I get a message like this 
when I try to work with the grid:

Scripting Error: [ok]
Microsoft VBScript runtime error - line 265, char 4
Variable is undefined: 'Grid'

This is when the auto-generated Display_Show routine for the 'Display' form 
containing the grid uses the following line:

      NSExecute "AddObject " & chr(34) & "GridCtrl.GridCtrl.1" & chr(34) & ", " 
& chr(34) & "Grid" & chr(34) & ", 4, 4, 220, 144, Display_Form"

As far as I can tell from experimenting with the 'GridHowToLite' sample project 
in the Files section, this syntax will work when the form with the grid on it 
is the startup form, otherwise it fails to add the grid and generates the 
'variable is undefined' message.

Under the heading of 'So crazy it just might work', I tried rewriting this as 
an ordinary AddObject line, the same way as the other Display form objects that 
load happily:

      AddObject "GridCtrl.GridCtrl.1", "Grid", 4, 4, 220, 144, Display_Form

This had no better results.

Finally, based on a message I found here on the group, I tried adding the grid 
from the very start of the program, at the same time as I add my SQLite 
connection:

AddObject "GridCtrl.GridCtrl.1", "Grid", 900, 900, 220, 144

In the Display_Load routine, I entered these line to move the Grid on-screen:
                Grid.Move 4, 4
                Grid.show

with the following lines in Display_Hide:
   Grid.move 900, 900

The result of this was half a loaf - no more error messages, but I still didn't 
see the grid on my pocket PC.

So, can anybody help with this? What's the right way to put a grid on a 
form-designer form? All of the grid examples that I've found, aside from 
GridHowToLite, seem to be using the model of adding all objects manually.

-- 
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en.

Reply via email to