Diferrent Opacities On a Form

I want to have multiple Opacities on a form.

Page 1 of 1

9 Replies - 3095 Views - Last Post: 11 September 2010 - 06:50 AM Rate Topic: -----

#1 Shayan.To10  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 7
  • Joined: 10-September 10

Diferrent Opacities On a Form

Posted 10 September 2010 - 06:00 AM

I want to have multiple Opacities on a form. For example: Have 2 PictureBoxes on a form that one of them have 50% opacity and other one have 100% opacity but the form has 0% opacity.
Is This A Good Question/Topic? 0
  • +

Replies To: Diferrent Opacities On a Form

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: Diferrent Opacities On a Form

Posted 10 September 2010 - 06:23 AM

The picturebox control itself does not support opacity. Even if you had an image with some transparent pixels it still will not show thru. You may get around this by setting the transparancy key on the original form - which will make it look invisible except for the controls, then add a form at whatever opacity you want to the original form like you would a normal control, then paint the image to this form where it will have some opacity. I haven't tested this, but think I might.
Was This Post Helpful? -1
  • +
  • -

#3 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 293
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: Diferrent Opacities On a Form

Posted 10 September 2010 - 06:35 AM

Or add each picturebox to a different form, set that ones opacity (and make it border less), then add the form (with the picturebox in it) to the Main Form.
Was This Post Helpful? 1
  • +
  • -

#4 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: Diferrent Opacities On a Form

Posted 10 September 2010 - 06:42 AM

Yeah that too, but they will be able to move the base form and change the apperance.
Was This Post Helpful? 0
  • +
  • -

#5 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: Diferrent Opacities On a Form

Posted 10 September 2010 - 07:11 AM

Nevermind, it won't let me add the form like a control. I thought I read an article where someone did this they even had a pic of it, humm...
Was This Post Helpful? 0
  • +
  • -

#6 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: Diferrent Opacities On a Form

Posted 10 September 2010 - 07:39 AM

Here is what I came up with , use both the transparency key and the opacity on the new form, draw the image, open the form. The only issue you will have is if they move the base form - if it is maximized and not sizable this won't be a problem. This makes the image have a transparency within/around the image with a faded opacity as well - ENJOY!!!

This post has been edited by hawkvalley1: 10 September 2010 - 07:40 AM

Was This Post Helpful? 0
  • +
  • -

#7 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1726
  • View blog
  • Posts: 5,704
  • Joined: 25-September 09

Re: Diferrent Opacities On a Form

Posted 10 September 2010 - 08:16 AM

,
You can add a form to a panel on a form, is that what you were thinking of?

  Dim f As New Form2()
  f.TopLevel = False
  Me.Panel1.Controls.Add(f)
  f.Show()

This post has been edited by CharlieMay: 10 September 2010 - 08:16 AM

Was This Post Helpful? 1
  • +
  • -

#8 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: Diferrent Opacities On a Form

Posted 10 September 2010 - 08:19 AM

I thought so too, but it is complaining about adding a top level control and forgot to check that property. Thanks

This post has been edited by hawkvalley1: 10 September 2010 - 08:20 AM

Was This Post Helpful? 0
  • +
  • -

#9 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: Diferrent Opacities On a Form

Posted 10 September 2010 - 08:30 AM

Funny thing is it does not give the same results as if the form is TopLevel - transparent image parts with opacity.
Was This Post Helpful? 0
  • +
  • -

#10 Shayan.To10  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 7
  • Joined: 10-September 10

Re: Diferrent Opacities On a Form

Posted 11 September 2010 - 06:50 AM

Excuse me. Is it possible to change the back color of a form to transparent?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1