473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

LinearGradientMode

101
Taking a VB .NET course that asked for me to create a gradient listbox, I created the brush like this:

Dim brGrad As New System.Drawing.Drawing2D.LinearGradientBrush( _
rct, _
Color.FromName(cboFromColor.Text), _
Color.FromName(cboToColor.Text), _
(CType(System.Enum.Parse( _
GetType(Drawing2D.LinearGradientMode), _
strGradient), Drawing2D.LinearGradientMode)))

They wrote it basically like this:

Dim brGrad As New System.Drawing.Drawing2D.LinearGradientBrush( _
rct, _
Color.FromName(cboFromColor.Text), _
Color.FromName(cboToColor.Text), _
(CType(System.Enum.Parse( _
GetType(Drawing2D.HatchStyle), _
strGradient), Drawing2D.LinearGradientMode)))

Both appear to give the same result. I am ASS U ME ing that that theirs worked because both are enumeratons in the drawing2 namespace that take the same type of argument.

How far off am I? Is mine the proper way to do it or did I miss something?
Nov 21 '05 #1
0 955

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bob | last post by:
Hi, I have struggled w/ this and can't get it to work. No examples found so far work for me. I have an app (source included) that connects to a sql server and reads (for this post) a zipcode...
13
by: Brian Henry | last post by:
I just wrote this in about 5 minutes, can someone have a look at it and leme know it this is a good way to do things like this? each item on the control is a object which has its own render...
0
by: JR | last post by:
Hi, i found a user control on the net see code below it is part of VSEssential but I like the coolProgressBar. Zo I want to use it into my program and I always get the error that it can't find...
4
by: Carlo, MCP | last post by:
Hello I found an abnormal behaviour on LinearGradientBrush (or FillRectangle). This code Public Class PanelPanel Inherits System.Windows.Forms.Panel Protected Overrides Sub OnPaint(ByVal e...
4
by: gene kelley | last post by:
The default ToolStrip apparently renders an MS Office Style ToolStrip when the RenderMode is other than "System". When using a BackgroundImage in the ToolStrip, this Office Style border has rounded...
2
by: Lespaul36 | last post by:
I have a control that I have made that uses a custom class for storage of some of the information. I want it to display in the VS.Net 2003 property grid in the IDE like the Font property does, so...
1
by: Diogo Alves - Software Developer | last post by:
Greetings, I've been trying to put an image on the background of a datagrid, I used the overriten property BackgroundImage, but it was useless (maybe I'm missing something). Could someone...
1
by: Bryon | last post by:
My current code paints a rectangular area at the top (under the menu and tool strip) and bottom (top of the status strip) of the main form with a linear gradient. The problem is that when the form...
4
by: =?Utf-8?B?Unlhbg==?= | last post by:
Why do I sometimes get this error; works fine most of the time: Rectangle '{X=0,Y=0,Width=0,Height=0}' cannot have a width or height equal to 0 void OnPaint(Object sender, PaintEventArgs e) {...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.