Solved

Alpha Blending Vb.Net forms

Posted on 2004-09-19
6
395 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

772 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