Board index » Visual Studio » How to transfer controls to a picture box?

How to transfer controls to a picture box?

Visual Studio263
Dear all.

Nebie vb6.

I have created a form with about 100 controls on it including text boxes,

labels, command buttons and list boxes which are arranged on the form in a

particular lay out. I want to put all these controls on a picture box or a

frame with the current lay out. I know I can delete them and then add a new

control on the picture box or frame but how can I do that without deleting

the current controls?

Thanks for any comments in advance.

DORI


-
 

Re:How to transfer controls to a picture box?

Quote
I have created a form with about 100 controls on it including text boxes,

labels, command buttons and list boxes which are arranged on the form in a

particular lay out. I want to put all these controls on a picture box or a

frame with the current lay out. I know I can delete them and then add a

new

control on the picture box or frame but how can I do that without deleting

the current controls?



Place your PictureBox (or Frame) somewhere on the form (don't worry where,

just make sure you can get to all of the controls you want to move).

Highlight all of the controls you want to move (either "lasso" them with the

mouse or Shift-Click on them). Once highlighted, Cut them (using either the

Edit menu or keying in Ctrl+X). Then select the PictureBox (or Frame) and

Paste the controls down (using either the Edit menu or keying in Ctrl+V). If

you already have code in the control's event procedures, don't worry about

them... they will be preserved.



Rick





-

Re:How to transfer controls to a picture box?

Hi Rick,

Thank you so much for the tip which saved me hours of work.

Regards,

DORI



"Rick Rothstein (MVP - VB)" wrote:



Quote
>I have created a form with about 100 controls on it including text boxes,

>labels, command buttons and list boxes which are arranged on the form in a

>particular lay out. I want to put all these controls on a picture box or a

>frame with the current lay out. I know I can delete them and then add a

>new

>control on the picture box or frame but how can I do that without deleting

>the current controls?



Place your PictureBox (or Frame) somewhere on the form (don't worry where,

just make sure you can get to all of the controls you want to move).

Highlight all of the controls you want to move (either "lasso" them with the

mouse or Shift-Click on them). Once highlighted, Cut them (using either the

Edit menu or keying in Ctrl+X). Then select the PictureBox (or Frame) and

Paste the controls down (using either the Edit menu or keying in Ctrl+V). If

you already have code in the control's event procedures, don't worry about

them... they will be preserved.



Rick







-

Re:How to transfer controls to a picture box?



"Rick Rothstein (MVP - VB)" <rickNOSPAMnews@NOSPAMcomcast.net>wrote in

message news:eh6BNKoXHHA.4868@TK2MSFTNGP03.phx.gbl...

Quote
>I have created a form with about 100 controls on it including text boxes,

>labels, command buttons and list boxes which are arranged on the form in

>a

>particular lay out. I want to put all these controls on a picture box or

>a

>frame with the current lay out. I know I can delete them and then add a

>new

>control on the picture box or frame but how can I do that without

>deleting

>the current controls?



Place your PictureBox (or Frame) somewhere on the form (don't worry where,

just make sure you can get to all of the controls you want to move).

Highlight all of the controls you want to move (either "lasso" them with

the mouse or Shift-Click on them). Once highlighted, Cut them (using

either the Edit menu or keying in Ctrl+X). Then select the PictureBox (or

Frame) and Paste the controls down (using either the Edit menu or keying

in Ctrl+V). If you already have code in the control's event procedures,

don't worry about them... they will be preserved.



Rick



Don't forget that the TabOrder will be shot to hell. (probably)



Dave O.





-

Re:How to transfer controls to a picture box?

Quote
>Place your PictureBox (or Frame) somewhere on the form (don't worry

>where, just make sure you can get to all of the controls you want to

>move). Highlight all of the controls you want to move (either "lasso"

>them with the mouse or Shift-Click on them). Once highlighted, Cut them

>(using either the Edit menu or keying in Ctrl+X). Then select the

>PictureBox (or Frame) and Paste the controls down (using either the Edit

>menu or keying in Ctrl+V). If you already have code in the control's

>event procedures, don't worry about them... they will be preserved.



Don't forget that the TabOrder will be shot to hell. (probably)



I just checked... it looks like if you select all of the controls, then no,

that TabIndex values remain the same. However, if you only pick some of the

controls, then the ones not Cut to the Clipboard get renumbered in sequence

starting with 1 (based on the order they were originally added to the

project) and then when you paste the Cut controls back down (no matter

where) they get then next sequential TabIndex values (again, based on the

order they were originally placed into the project).



Rick





-

Re:How to transfer controls to a picture box?

"Rick Rothstein (MVP - VB)" <rickNOSPAMnews@NOSPAMcomcast.net>wrote in

message news:uV7Y3MxXHHA.2640@TK2MSFTNGP06.phx.gbl...



Quote
>Don't forget that the TabOrder will be shot to hell. (probably)



I just checked... it looks like if you select all of the controls, then

no, that TabIndex values remain the same.



Really? It was always my experience that the tab order was reversed. Maybe I

haven't done it in a long time because that used to be the case in an older

version and got fixed at some point.





-

Re:How to transfer controls to a picture box?



"Jeff Johnson" <i.get@enough.spam>wrote in message

Quote
"Rick Rothstein (MVP - VB)" <rickNOSPAMnews@NOSPAMcomcast.net>wrote in

message news:uV7Y3MxXHHA.2640@TK2MSFTNGP06.phx.gbl...



>>Don't forget that the TabOrder will be shot to hell. (probably)

>

>I just checked... it looks like if you select all of the controls, then

>no, that TabIndex values remain the same.



Really? It was always my experience that the tab order was reversed. Maybe

I haven't done it in a long time because that used to be the case in an

older version and got fixed at some point.

Yes, that's what I thought.

I found if I cut what I had pasted and then pasted it again, the tab order

was (often) correct, but it was so unreliable I had to check it by hand so I

might just as well sort it all out then.



Dave O.





-