On May 22, 2006, at 10:18 AM, Juan Salvatierra wrote:


El 22/05/2006, a las 17:40, Rafael Vallejo escribió:


Good to see a lot of messages on this discution, but my problem still there, I created a new class and assigned it's super as canvas, but the problem is still there "nilobjectexepction".


;-D  Sorry for that!

But it seems we have already given a (possibly working) solution:

1) Create a canvas in your window. It will be named Canvas1 normally, but you can rename it. Place it out of the window, so that it will not bother you.
2) Begin your sub with:

dim o as new Canvas1

And set the index of Canvas1 to 0 in the Properties pane. If you do all of that correctly you will get past the nil object in your posted code.

By the way, you can just use the Append method to add your new canvas's into the array without redimming the array.

Also, doing your drawing with TheCanvas.Graphics property is likely to give some surprises. If you want a sustainable screen image you will have to have drawing code in the Paint event, and if you plan to print you need to get a graphics object from OpenPrinter(). It's best to put your drawing code in a method which takes a parameter: g as graphics. Then you can call the draw method from both the Paint and your Printing method by passing in the appropriate g.

Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to