Solved

ASP.net v VB.net Gradient colors

Posted on 2014-03-03
2
318 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

8 Experts available now in Live!

Get 1:1 Help Now