Solved

Alpha Blending Vb.Net forms

Posted on 2004-09-19
6
393 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now