form stacking and visibility using transparency

G

Guest

How do I control the layering of 4 forms of identical size and position to
cause the desired form to be second from the top..

Form1 has my welcome screen etc.and the code for file manipulations etc. etc

Form2 has a foreground image of a decorative picture frame (,png image) with
a transparent center, and a tab control for the user to select .bmp
pictures to view.

Form3 has a "picturebox" into which is loaded the user.bmp file image
selected in form2

I display the user image using a "picutrebox" on Form3, and since the
picturebox is set to a size much larger than the form I can scroll it at
will even beyond the size of the form, with the user seeing only the portion
behind the transparen center of the picture frame.

II tried using just Form2, but if my image is used as the background, I
cannot over size it and manipulate the location and size, and of course, if
it is the foreground, then my image of the picture frame will not appear in
front of it.
So now I have the picture frame as forground image of Form2
Backgound color of Form2 as transparent.
So now the picture frame shows form1 or the desk top below.
I created form3 to display the user images, and scroll the picture as
needed.

Other than send to the top or send to the bottom, how do I control the
stacking of mutlple forms of identical size and location, so I can specify
which form is on top, and which comes 2nd 3rd etc in order to make use of
transparency in various layers. The use must not be able to move the forms.

thanx......joisey
 
S

stephen.a.hall

I would suggest not using forms. instead, perhaps just use stacked
panels on a form.

You can get control of the paint and transparency of a control by:

Me.SetStyle(System.Windows.Forms.ControlStyles.DoubleBuffer, True)
Me.SetStyle(System.Windows.Forms.ControlStyles.AllPaintingInWmPaint,
False)
Me.SetStyle(System.Windows.Forms.ControlStyles.ResizeRedraw, True)
Me.SetStyle(System.Windows.Forms.ControlStyles.UserPaint, True)
Me.SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor,
True)
MyBase.BackColor = System.Drawing.Color.Transparent

-Steve.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top