Results 1 to 6 of 6

Thread: Cut and Paste Portions of a Form

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    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.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest
    Code for module.

    Code:
    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.

    Code:
    BitBlt Form1.hDC, 0, 0, 50, 50, Pic1.hDC, 0, 0, SRCCOPY
    [Edited by Megatron on 06-26-2000 at 07:33 PM]

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Thanks Guys,
    I won't forget your help.
    Joey o.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    One lost puppy

    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.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width