Solved

ASP.net v VB.net Gradient colors

Posted on 2014-03-03
2
322 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:Murray Brown
[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
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:Murray Brown
ID: 39911798
Thanks
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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 …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

696 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