Solved

ASP.net v VB.net Gradient colors

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

867 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

16 Experts available now in Live!

Get 1:1 Help Now