Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Alpha Blending Vb.Net forms

Posted on 2004-09-19
6
Medium Priority
?
407 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

618 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