Click to See Complete Forum and Search --> : Cut and Paste Portions of a Form
joey o.
Jun 26th, 2000, 12:14 AM
Hi everyone!
Does anyone have any code to help me with understanding cut and pasting portions of forms with rubber banding wether it be text or graphics.
P.S. The form uses no controls and thats the way I want to learn this. Can it be done?
Thanks in advance,
Joey O.
kedaman
Jun 26th, 2000, 05:46 AM
Sure, if it is the graphics part you want, you need to put an invisible nonautoredraw picturebox at 0,0 on your form and then use bitblt api to copy the graphics, this will get the surface of all the controls to, not just the form
Code for module.
Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Public Const SRCCOPY = &HCC0020
Code for Activate event of the Form. For example's sake, I used Pic1.hDC, but you can replace it with an DC you want.
BitBlt Form1.hDC, 0, 0, 50, 50, Pic1.hDC, 0, 0, SRCCOPY
[Edited by Megatron on 06-26-2000 at 07:33 PM]
joey o.
Jun 26th, 2000, 09:48 AM
Thanks Guys,
I won't forget your help.
Joey o.
joey o.
Jun 26th, 2000, 09:39 PM
Oh No!
I was so thrilled to get answers that I didn't take the time to see if I understood them.Could anyone elaberate on how to implement this code? I'm lost.
kedaman
Jun 26th, 2000, 10:20 PM
Bitblt is an apicall, you need to put it in your declarations section, if in a form, put private before the statement, but you could also put it in a standard module
put a picturebox on the form and name it pic1, put the call in the forms active event.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.