Clipping over multiple forms 
Author Message
 Clipping over multiple forms

Why not copy the two pictureboxes into one larger one ?

On Thu, 22 Nov 2001 04:33:34 GMT,

Quote:

>Suppose you have a FORM with two picture boxes on it.
>One covers the top half of the form.
>The other covers teh bottom half.

>You want to click and draw a {*filter*}band rectangle anywhere on this
>form, even if it means stretching across two forms.

>Suppose you want to do this for copy and paste purposes, such as
>copying a region marked by the {*filter*}band rectangle?

>=============

>The top picturebox is my chart.
>The bottom is a separate chart.
>I want to be able to stretch my {*filter*}band rectangle over one or both
>charts to copy...

>My rectangle of course is currently limited to within the top
>picturebox. I'm not sure if and how I can program this to go across
>objects (pictureboxes).

>Is there a way?

>Thanks.

>Rick R.

>Rick J. Ratchford
>FutureSoft Publishing
> http://www.*-*-*.com/



Mon, 10 May 2004 16:38:57 GMT  
 Clipping over multiple forms
Suppose you have a FORM with two picture boxes on it.
One covers the top half of the form.
The other covers teh bottom half.

You want to click and draw a {*filter*}band rectangle anywhere on this
form, even if it means stretching across two forms.

Suppose you want to do this for copy and paste purposes, such as
copying a region marked by the {*filter*}band rectangle?

=============

The top picturebox is my chart.
The bottom is a separate chart.
I want to be able to stretch my {*filter*}band rectangle over one or both
charts to copy...

My rectangle of course is currently limited to within the top
picturebox. I'm not sure if and how I can program this to go across
objects (pictureboxes).

Is there a way?

Thanks.

Rick R.

Rick J. Ratchford
FutureSoft Publishing
http://www.*-*-*.com/



Mon, 10 May 2004 12:33:34 GMT  
 Clipping over multiple forms
Thanks Jerry.

I don't follow.

As the permanent display, or only when looking to clip the contents?
The latter would be odd, with a copy of the original ontop of the
original. I'd expect the prior to slow scrolling and other features
I've added to mousemove, click, etc to act on the original picture
boxes.

Doing this only when desiring to clip though is a possibility, if
there are no other ways to get around this.



Quote:
>Why not copy the two pictureboxes into one larger one ?

>On Thu, 22 Nov 2001 04:33:34 GMT,

>>Suppose you have a FORM with two picture boxes on it.
>>One covers the top half of the form.
>>The other covers teh bottom half.

>>You want to click and draw a {*filter*}band rectangle anywhere on this
>>form, even if it means stretching across two forms.

>>Suppose you want to do this for copy and paste purposes, such as
>>copying a region marked by the {*filter*}band rectangle?

>>=============

>>The top picturebox is my chart.
>>The bottom is a separate chart.
>>I want to be able to stretch my {*filter*}band rectangle over one or both
>>charts to copy...

>>My rectangle of course is currently limited to within the top
>>picturebox. I'm not sure if and how I can program this to go across
>>objects (pictureboxes).

>>Is there a way?

>>Thanks.

>>Rick R.

>>Rick J. Ratchford
>>FutureSoft Publishing
>> http://www.*-*-*.com/

Rick J. Ratchford
FutureSoft Publishing
http://www.*-*-*.com/


Tue, 11 May 2004 05:12:43 GMT  
 Clipping over multiple forms
On Thu, 22 Nov 2001 21:12:43 GMT,

Quote:

>Thanks Jerry.
<snip>
>Doing this only when desiring to clip though is a possibility, if
>there are no other ways to get around this.

Yup - that is what I meant - go into 'clip mode' and let the user feel
that they are doing something dramatic.

There is another method - you are using a rectangle - perhaps you
could 'resize' a control over the screen - rather like sizing a
control in design mode - then work out what was under it.

Here is some code for resizing a borderless Form - it will work for
any control with a hWnd - you could resize a Picturebox over the other
two - and copy the data into that ----- so..it I should have thought
of that earlier.

Option Explicit

' Resize Borderless Forms

' Set BorderStyle = None
' Add a Command Button

Private Declare Function SendMessage _
                 Lib "user32" Alias "SendMessageA" _
                 (ByVal hwnd As Long, _
                  ByVal wMsg As Long, _
                  ByVal wParam As Integer, _
                  ByVal lParam As Any) As Long

Private Declare Function ReleaseCapture _
                 Lib "user32" () As Long

' --- Simulate a Click on Constants
Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2
Const HTLEFT = 10
Const HTRIGHT = 11

Private Sub Form_Load()
   Me.Caption = ""
   Command1.Caption = "CLOSE"
End Sub

Private Sub Command1_Click()
    Unload Me
End Sub

'
#######################################################################
'
' Move the Form - Drag Simulation
'
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
    If Button = vbLeftButton Then
       If Y < 300 Then
          ReleaseCapture  ' Release Mouse Capture from this Form
          ' --- inform the form that there is a click on the Caption
area
          SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
          Exit Sub
       End If
       If X > Me.Width - 100 Then
          ReleaseCapture  ' Release Mouse Capture from this Form
          ' --- inform the form that there is a click on the right
border
          SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTRIGHT, 0&
       End If
       If X < 100 Then
          ReleaseCapture  ' Release Mouse Capture from this Form
          ' --- inform the form that there is a click on the left
border
          SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTLEFT, 0&
       End If
    End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
    Dim Q%
    Q = vbDefault
    If X < 100 Or X > Me.Width - 100 Then
       Q = vbSizeWE
    End If
    If Me.MousePointer <> Q Then
       Me.MousePointer = Q
    End If
End Sub

Quote:



>>Why not copy the two pictureboxes into one larger one ?

>>On Thu, 22 Nov 2001 04:33:34 GMT,

>>>Suppose you have a FORM with two picture boxes on it.
>>>One covers the top half of the form.
>>>The other covers teh bottom half.

>>>You want to click and draw a {*filter*}band rectangle anywhere on this
>>>form, even if it means stretching across two forms.

>>>Suppose you want to do this for copy and paste purposes, such as
>>>copying a region marked by the {*filter*}band rectangle?

>>>=============

>>>The top picturebox is my chart.
>>>The bottom is a separate chart.
>>>I want to be able to stretch my {*filter*}band rectangle over one or both
>>>charts to copy...

>>>My rectangle of course is currently limited to within the top
>>>picturebox. I'm not sure if and how I can program this to go across
>>>objects (pictureboxes).

>>>Is there a way?

>>>Thanks.

>>>Rick R.

>>>Rick J. Ratchford
>>>FutureSoft Publishing
>>> http://www.*-*-*.com/

>Rick J. Ratchford
>FutureSoft Publishing
> http://www.*-*-*.com/



Tue, 11 May 2004 05:56:29 GMT  
 Clipping over multiple forms
On Thu, 22 Nov 2001 21:12:43 GMT,

Rick, i've just tried to draw a label across two pictureboxes and
didn't seem to have trouble doing that. Apart from the rectangle not
showing on top of the picture boxes. :-/  
If you were to draw your own rectangle on top though..

What i did was to trap Mouse Down, Up and Move. On MouseUp you'd have
the given coordinates of the rectangle and so you could determine the
areas to be copied from both pictureboxes.. bit of doing so don't go
swearing at me if you decide to use it. ;-)
Have a look, maybe you can do something with it.  I also thought about
disabling the pictureboxes in mousemove..but that could be a nightmare
to keep bug free as well.

Dim inSel as Boolean

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
    If inSel = True Then Exit Sub
    If Button Then
        inSel = True
        label1.left = Picture1.left + X
        label1.top = Picture1.top + Y
        label1.Visible = True
    End If
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
    If inSel = True Then
        label1.Width = X
        label1.Height = Y
    End If
End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
    If inSel = True Then
        inSel = False
        Caption = label1.left & " : " & label1.top & _
        " - " & label1.Width & " : " & label1.Height
        label1.Visible = False
    End If
End Sub

Private Sub Picture2_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
    If inSel = True Then
        inSel = False
        Caption = label1.left & " : " & label1.top & _
        " - " & label1.Width & " : " & label1.Height
        label1.Visible = False
    End If
End Sub

Regards, Frank



Tue, 11 May 2004 06:24:14 GMT  
 Clipping over multiple forms


Quote:
>There is another method - you are using a rectangle - perhaps you
>could 'resize' a control over the screen - rather like sizing a
>control in design mode - then work out what was under it.

LOL ! Get outa here, that will never work.  ;-)

Regards, Frank



Tue, 11 May 2004 06:32:39 GMT  
 Clipping over multiple forms
Thanks guys.

Rick



Quote:
>On Thu, 22 Nov 2001 21:12:43 GMT,

>Rick, i've just tried to draw a label across two pictureboxes and
>didn't seem to have trouble doing that. Apart from the rectangle not
>showing on top of the picture boxes. :-/  
>If you were to draw your own rectangle on top though..

>What i did was to trap Mouse Down, Up and Move. On MouseUp you'd have
>the given coordinates of the rectangle and so you could determine the
>areas to be copied from both pictureboxes.. bit of doing so don't go
>swearing at me if you decide to use it. ;-)
>Have a look, maybe you can do something with it.  I also thought about
>disabling the pictureboxes in mousemove..but that could be a nightmare
>to keep bug free as well.

>Dim inSel as Boolean

>Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X
>As Single, Y As Single)
>    If inSel = True Then Exit Sub
>    If Button Then
>        inSel = True
>        label1.left = Picture1.left + X
>        label1.top = Picture1.top + Y
>        label1.Visible = True
>    End If
>End Sub

>Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X
>As Single, Y As Single)
>    If inSel = True Then
>        label1.Width = X
>        label1.Height = Y
>    End If
>End Sub

>Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As
>Single, Y As Single)
>    If inSel = True Then
>        inSel = False
>        Caption = label1.left & " : " & label1.top & _
>        " - " & label1.Width & " : " & label1.Height
>        label1.Visible = False
>    End If
>End Sub

>Private Sub Picture2_MouseUp(Button As Integer, Shift As Integer, X As
>Single, Y As Single)
>    If inSel = True Then
>        inSel = False
>        Caption = label1.left & " : " & label1.top & _
>        " - " & label1.Width & " : " & label1.Height
>        label1.Visible = False
>    End If
>End Sub

>Regards, Frank

Rick J. Ratchford
FutureSoft Publishing
http://fdates.com


Fri, 21 May 2004 13:24:53 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Releasing clipped cursor w/multiple monitors.

2. Printing a large form - clipping at the bottom

3. form clipping

4. Put icon on Form w/o Clip controls?

5. Include form on clip

6. Q: PrintForm method clips labels on the Form

7. Clipped Toolbar Buttons When Setting Form Size

8. Form Clip control

9. MDI Form clip controls

10. DDEServer with multiple topics requires multiple forms?

11. Link multiple datagrids to a single record (Master\Detail Form with multiple details)

12. maximize child form display multiple tool box controls on main form

 

 
Powered by phpBB® Forum Software