473,782 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

color to brush

having a moment,

cant you just
Brush br = new Brush(Color.Bla ck);??? saying you cant cos it's an abstract
class

need to get to a brush from a color

tia
sam martin
Nov 15 '05 #1
2 43462
Hi,

Use SolidBrush instead.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"boxim" <sa*********@ya hoo.co.uk> wrote in message
news:un******** ******@tk2msftn gp13.phx.gbl...
having a moment,

cant you just
Brush br = new Brush(Color.Bla ck);??? saying you cant cos it's an abstract
class

need to get to a brush from a color

tia
sam martin

Nov 15 '05 #2
n!
> cant you just
Brush br = new Brush(Color.Bla ck);??? saying you cant cos it's an abstract
class

need to get to a brush from a color


You need to use SolidBrush for a solid color. You can also gain access to a
colored brush with:

Brush br = Brushes.Black;

(which exists in the System.Drawing namespace).

n!
Nov 15 '05 #3

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

Similar topics

5
3492
by: JJ | last post by:
Hi all, I am using the color dialog box to select a colour to print with. However, the e.Graphics.DrawString method uses Brushes.Black, not Color.Black. How do I convert from Brushes to Colors and back
3
15405
by: Mad Scientist Jr | last post by:
Can someone post a clear example of how to change the background color of an individual datagrid cell for a Windows desktop app? (preferably in vb.net) I found some code on how to do this when the user clicks on the cell: Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.CurrentCellChanged DataGrid1.Controls(DataGrid1.CurrentCell.ColumnNumber + 2).BackColor =...
2
19946
by: JR | last post by:
Hi, I need a color to Brush convert function. something like this Function GetColorBrush(cColor as color) as brush dim sColor as string = cColor.name return brushes(sColor) End function ofcourse this won't work but who will help me
1
3861
by: =?Utf-8?B?UEtsZW1t?= | last post by:
how to serialize a brush object with the XmlSerializer without knowing the brush type?
2
7854
by: DNB | last post by:
I would like to add this color #E7EBF7 to my WPF data grid I know that I can add light blue color using following: Grid b = new Grid(); b.Background = System.Windows.Media.Brushes.LightBlue;
3
29320
by: CSharper | last post by:
Is it possible to selectivly change the color of an item in text. I saw ForeColor option, but it changes the color of all the items. If it is not possible, is there any other control list listbox where we can see more than one item and change the color during run time. Thanks.
5
7185
by: moondaddy | last post by:
I have a custom control where users can set the backcolor of one of it's UI elements via a DP I created. One of the colors they can pick is a brush called CustomGradient where I would set the DP to this brush. Then from a color picker I would let them pick a solid color brush and set 2 of the gradient stops to this new value. So for example, here's the style:
0
1282
by: steve | last post by:
When drawing with a hatch brush with a statement such as myGraphics.FillPolygon(hatchBrush, polygon.vertices); the hatch brush is always oriented in the same direction. Is there a way of rotating the brush so that I can give it a different orientation for each polygon? I.e. if it was a triangle and it was drawn upright then the brush would appear as normal but if the triangle was drawn upside down the hatch brush pattern would...
31
3417
by: Tom P. | last post by:
I am doing quite a bit of custom painting and it means I have to create a lot of brushes (think one for every file system object in a directory) per paint. How expensive is this? Should I find a way to create the brushes once, store them in an member variable, and use them when I need them? Or is creating brushes a throw-away process that doesn't take a lot of work? Thanks for the info. Tom P.
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9946
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.