Actually, looking into it as I have, the "design mode at runtime" issue isn't resolvable, not by simply "setting" a design mode flag. Why? MS' own design mode controls are made so that they **cannot** be created in that state, unless you have one of their compilers installed. Basically, it would work on the test platform the application was created on, if you could get it to work at all, but not anyplace else. Also, regular windows may not *have* a "mode" setting, since its not something standard, unless its also a MS control, created in the same environment that the design time controls from MS work in.
The only real solution is to implement something in the container (frame, etc.) that acts like the original "mode" feature. You then set up something that will either hide, or disable user input, for the control to be moved. Once its dead to user input you stick some boxes around it, for the size box and drag handles, let the user move "those" around, then, when done, move and resize the control to "fit" the new location of those boxes, before making it active/visible again. The trick is, if you want to see what it looks like as you move it, that instead of making a single bit of generic code to draw a fake box and handles, then moving that, you have to implement the code for them in *every* control, then use something like the UIDead function and a redirection of the draw code in the control, to make it work. There is an example some place I saw of making this "faked" system in VB, but I ignored it at the time, since it wasn't what I was trying to get working.
Personally I always thought this was a kludge, since there was already code implemented to handle this with most installed activex controls. But, due to the stupid, "You must have a license for Visual Studio installed on your machine to create design time controls in your application.", BS, its pretty much the only way it can be done. And, I suspect now that its basically exactly what the code in all those activeX controls does, with one extra bloody check to see if the license is installed, if you try to "create" one of them while *in* design mode. Actually setting the mode, as long as its not "also" an activeX, would probably be as simple as replicating the mode flag and what ever event gets fired to announce to hosted controls that it changed. But, I am not sure it simply temporarily switching the container to "runtime" creating the control, then switching the container to "design" gets around the bloody license or not. And, you **definitely** don't want to use activeX or other prebuilt MS controls that already have the flag. Its buried in some idiotic hidden attribute mess, which takes a crowbar and a voodoo ritual to change modes. lol |