Solved

ASP.net v VB.net Gradient colors

Posted on 2014-03-03
2
316 Views
Last Modified: 2014-03-06
Hi. I want to get a gradient effect on a panel in my Windows forms application in the seven different ways that you can achieve this with an ASP.net chart shown below.
For a LeftRight gradient in my ASP.net chart I use the VB.net code at the bottom to achieve
the same on my Windows Forms panel. What code would I use to achieve the other chart gradients in the list on my Windows Forms Panel

chart1.BackGradientStyle = GradientStyle.LeftRight

Centre
Dialgonal Left
Diagonal Right
Horizontal Centre
Left Right
Top Bottom
Vertical Centre

            Dim graphics As Graphics = pChartBackColor.CreateGraphics

            Dim rectBrush As New System.Drawing.Rectangle(0, 0, 46, 46)
            Dim brush As LinearGradientBrush
            brush = New LinearGradientBrush(rectBrush, Color.FromArgb(A, R, G, B), _
                                    Color.White, LinearGradientMode.Horizontal)
0
Comment
Question by:murbro
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39900464
You have some that have different names in the LinearGradientMode enum like

Diagonal Left ~ Backward Diagonal
Diagonal Right ~ Forward Diagonal

etc.

Try checking all of the available modes in LinearGradientMode enum to see which one you are able to use.
0
 

Author Closing Comment

by:murbro
ID: 39911798
Thanks
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

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

20 Experts available now in Live!

Get 1:1 Help Now