DRAWINTO from "new" control

I have a need to draw a control on to a picture object.

The problem is I need to do this from a function independant of any window that may have a similar control

I tried this

dim cb as new checkbox
db.drawinto pic.graphics,0,0

and while it compiled, and ran… it did nothing

If I reference a control that IS on a window… it works fine. but I may need to draw a control that the actual program doesn’t have.

That is exactly what I was trying to avoid :frowning:

[quote=49345:@Dave S]I have a need to draw a control on to a picture object.
The problem is I need to do this from a function independant of any window that may have a similar control[/quote]
I’ve been think about that, too…

Let’s assume: I’d like to create a custom Canvas based Control, and I’d like to have a Checkbox drawn on it.
How can this be achieved? I obviously can’t place a Checkbox on the Canvas subclass. And since I don’t know where this custom Control is being used, I can’t reference a “control that is on a window”.

So how can this be done, if at all?

What might that be…? It seems there is some previous reply missing…

no idea… that was almost 5 years ago :slight_smile: Heck I don’t even remember what project I was working on

I’d still like to know how one would do this:

  1. New Picture somewhere in Code of a Class or Module
  2. a custom Canvas subclass
    Where to place the Control that one would like to .DrawInto (the Picture, the custom Canvas)?

Place it outside the window to the left, and DON‘T lock it to any side.

There is no Window if one creates a custom Canvas Subclass… :frowning:

One “workaround” I guess is to use a ContainerControl, put the Canvas on there (and place the Control(s) outside, such as you’ve described).
There’s really no way to have “just a Canvas subclass” draw Controls?

There is not. You cannot create a control on the fly. It must already be on the window or be part of a control set (one of which is already on the window).