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

x
?
Solved

ASP.net v VB.net Gradient colors

Posted on 2014-03-03
2
Medium Priority
?
332 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 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
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

636 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