Solved

Alpha Blending Vb.Net forms

Posted on 2004-09-19
6
398 Views
Last Modified: 2012-06-27
Hi is it possible to alphablend the back ground color of a windows form. And if so how do I do it.

Thanks in advance.
0
Comment
Question by:ConsensusIT
6 Comments
 
LVL 4

Expert Comment

by:vigrid
ID: 12096396
Yes. You only need to change the Opacity property of the form, while 1.0 being completely opaque, and 0.0 being completely transparent.

Me.Opacity = 0.5

Above will tell the form to be half-transparent.

HTH?
0
 

Author Comment

by:ConsensusIT
ID: 12098117
What I actually meant was that the forms background color went from say blue to lighter shades of blue as it went down the screen.

Thanks anyway.
0
 
LVL 4

Accepted Solution

by:
vigrid earned 500 total points
ID: 12098585
You have to create a System.Drawing.Drawing2D.LinearGradientBrush and fill the form by handling its Paint event.

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs)
      Dim brush1 As LinearGradientBrush = New LinearGradientBrush(MyBase.ClientRectangle, Color.Blue, Color.LightBlue, LinearGradientMode.Vertical)
      e.Graphics.FillRectangle(brush1, MyBase.ClientRectangle)
End Sub

HTH
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Expert Comment

by:armoghan
ID: 12099205
0
 
LVL 2

Expert Comment

by:ahmadfuwad
ID: 12100310
set the Opacity  property
0
 
LVL 4

Expert Comment

by:vigrid
ID: 12128070
Thanks for the points. BTW what you needed is not called "Alpha blending", but gradient shading :). Alpha blending is done when you need transparency effects, not simple color changes.

Have fun :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question