?! Rubberband always at the background ?! 
Author Message
 ?! Rubberband always at the background ?!

Hi !
I want to create a {*filter*}band. With this {*filter*}band I want to select object
(like VB Design Mode) . The object at these form are mainly picture boxes. I
create the {*filter*}band with a line method BUT VB paint the {*filter*}band always
UNDER the object?!?!?

Any hint or tips to get the {*filter*}band to "ZOrder 0" ?!?!?!

Greetings

Uwe



Thu, 17 Aug 2000 03:00:00 GMT  
 ?! Rubberband always at the background ?!

There are a number (3 or 4?  I forget...) of graphics "levels" on a VB
form.  Graphics drawn on the form itself are at the lowest level.
Graphical controls (eg label) are next, and fully-windowed controls (eg
picturebox) above those.  Anything drawn on a higher level will always
cover anything on a lower one.

If you must get your {*filter*}bands to show up over your pictureboxes, you'll
have to draw them _on_ your pictureboxes.  I can't think of an easy way to
do this... Detecting when your lines cross controls is possible, but it's
not a one-liner, that's for sure!

Jim Deutch
MS Dev MVP



Quote:
> Hi !
> I want to create a {*filter*}band. With this {*filter*}band I want to select
object
> (like VB Design Mode) . The object at these form are mainly picture
boxes. I
> create the {*filter*}band with a line method BUT VB paint the {*filter*}band
always
> UNDER the object?!?!?

> Any hint or tips to get the {*filter*}band to "ZOrder 0" ?!?!?!

> Greetings

> Uwe



Fri, 18 Aug 2000 03:00:00 GMT  
 ?! Rubberband always at the background ?!

Hi Jim:

Quote:
>If you must get your {*filter*}bands to show up over your pictureboxes, you'll
>have to draw them _on_ your pictureboxes.  I can't think of an easy way to
>do this... Detecting when your lines cross controls is possible, but it's
>not a one-liner, that's for sure!

What about ClipControls = False?

Doug.



Fri, 18 Aug 2000 03:00:00 GMT  
 ?! Rubberband always at the background ?!

Quote:

> Hi !
> I want to create a {*filter*}band. With this {*filter*}band I want to select object
> (like VB Design Mode) . The object at these form are mainly picture boxes. I
> create the {*filter*}band with a line method BUT VB paint the {*filter*}band always
> UNDER the object?!?!?

> Any hint or tips to get the {*filter*}band to "ZOrder 0" ?!?!?!

Hi,

If you can't beat them - join them!

Put 4 PictureBoxes (picH1,picH2,picV1,picV2) on your form adn add this code

Sub Form_MouseDown (button As Integer, Shift As Integer, x As Single, y As Single)
    If button = 1 Then
        picH1.Left = x
        picH1.Top = y
        picH2.Left = x
        picH2.Top = y
        picV1.Left = x
        picV1.Top = y
        picV2.Left = x
        picV2.Top = y

        picH1.Width = 15
        picH2.Width = 15
        picV1.Height = 15
        picV2.Height = 15

        picH1.height = 15
        picH2.height = 15
        picV1.width = 15
        picV2.width = 15

        picH1.zorder
        picH2.zorder
        picV1.zorder
        picV2.zorder
    End If
End Sub

Sub Form_MouseMove (button As Integer, Shift As Integer, x As Single, y As Single)
    If button = 1 Then
        picH1.Width = x - picH1.Left
        picH1.Top = y
        picH2.Width = picH1.Width
        picV1.Height = y - picV1.Top
        picV2.Height = picV1.Height
        picV2.Left = x
    End If
End Sub

Hope this helps

Michaela



Fri, 18 Aug 2000 03:00:00 GMT  
 ?! Rubberband always at the background ?!

Quote:

>I want to create a {*filter*}band. With this {*filter*}band I want to select object
>(like VB Design Mode) . The object at these form are mainly picture boxes. I
>create the {*filter*}band with a line method BUT VB paint the {*filter*}band always
>UNDER the object?!?!?

I've seen a sample by Daniel Appleman with a screen capture program,
where you could drag a {*filter*}band rectangle directly onto the screen,
not just inside a window. Unfortunately for you, it's in VB3/16-bit. I
think you could port it to Win32.

You probaly still can find it on Appleman's site, www.desaware.com. The
file is NL1MAIN.ZIP, size about 12k ("Top 10 API calls").

HTH,
Bart.



Sat, 19 Aug 2000 03:00:00 GMT  
 ?! Rubberband always at the background ?!

I don't think ClipControls will have any effect (but I haven't tried it).

I like Bert's idea.  You can use XOr drawing on the DC obtained from
GetDC("Display",0&,0&,0&).  Just be sure you go back over it to wipe it
out!  You're drawing all over my screen and I can't repaint!

Jim Deutch



Quote:
> Hi Jim:

> >If you must get your {*filter*}bands to show up over your pictureboxes,
you'll
> >have to draw them _on_ your pictureboxes.  I can't think of an easy way
to
> >do this... Detecting when your lines cross controls is possible, but
it's
> >not a one-liner, that's for sure!

> What about ClipControls = False?

> Doug.



Tue, 22 Aug 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Rubberband Arc or Rubberband Curve

2. How to set a Form always in background

3. Ico background not always is transparent

4. AnimateWindow: background always black?

5. AnimateWindow - background always black?

6. RubberBand UserControls

7. Rubberband Line

8. Rubberband Rectangle in ACCESS-Form via WinApi

9. Drawing rubberband OVER controls

10. RubberBand TextBox

11. RubberBand TextBox

12. Rubberband Line with ScrollBar

 

 
Powered by phpBB® Forum Software