473,326 Members | 2,196 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,326 software developers and data experts.

Using glyphs in C#

Hi!

I want to do kind of an easy thing, but i don't now HOW:

I have a lot of buttons, i want to place glyphs on them!
Unfortunately, i didn't found kind of a "glyph-property", so i don't
know how to do that!

I just thought about writing a class that handles this on my own, but
it's sounds a bit hard! ;-)
Furthermore, I'm very surprised that this function isn't natively
supported?!?

Home somebody can help!

Jun 9 '06 #1
5 6320
maybe this will work for you...

Button btn = new Button()
btn.Image = Image.FromFile("filename");

Regards,
John

<ra********@gmx.at> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Hi!

I want to do kind of an easy thing, but i don't now HOW:

I have a lot of buttons, i want to place glyphs on them!
Unfortunately, i didn't found kind of a "glyph-property", so i don't
know how to do that!

I just thought about writing a class that handles this on my own, but
it's sounds a bit hard! ;-)
Furthermore, I'm very surprised that this function isn't natively
supported?!?

Home somebody can help!

Jun 9 '06 #2
A glyph is a symbol. A symbol is an image. Are you saying that you don't
know how to put an image on a button? Or am I lacking some key piece of
information?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

<ra********@gmx.at> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Hi!

I want to do kind of an easy thing, but i don't now HOW:

I have a lot of buttons, i want to place glyphs on them!
Unfortunately, i didn't found kind of a "glyph-property", so i don't
know how to do that!

I just thought about writing a class that handles this on my own, but
it's sounds a bit hard! ;-)
Furthermore, I'm very surprised that this function isn't natively
supported?!?

Home somebody can help!

Jun 9 '06 #3
A glyph IS a symbol / image indeed, BUT a glyph contains the images of
several states, for example in a glyph there are 2 images, one for the
state the button is klicked (and stays clicked), and one for the button
in "normal" state!

I know, i could use 2 images instead, and simply change it in depending
of the button-state for example, but i have A LOT of buttons, and i
often used my glyphs in an other programming language and it all worked
fine....
Kevin Spencer schrieb:
A glyph is a symbol. A symbol is an image. Are you saying that you don't
know how to put an image on a button? Or am I lacking some key piece of
information?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

<ra********@gmx.at> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Hi!

I want to do kind of an easy thing, but i don't now HOW:

I have a lot of buttons, i want to place glyphs on them!
Unfortunately, i didn't found kind of a "glyph-property", so i don't
know how to do that!

I just thought about writing a class that handles this on my own, but
it's sounds a bit hard! ;-)
Furthermore, I'm very surprised that this function isn't natively
supported?!?

Home somebody can help!


Jun 9 '06 #4
Ah, my bad, I didn't realize you were talking about the "Glyph" that is part
of the System.Windows.Forms.VisualStyles namespace. I thought you were
talking about the generic term. Sorry.

I must confess I haven't had much opportunity to delve into this namespace
very deeply. It's some pretty deep and complex stuff. It's all linked in
with the XP Operating System, and it's skinning ability. I don't really
think that's what you want. Perhaps instead you could create your own
inherited Button class, your own Glyph class, with several different Bitmaps
to use, and manage the OnPaint method of the Button to draw the surface of
the Button with one of the Bitmaps, depending upon the Button state.

If you're interested in digging into the System.Windows.Forms.VisualStyles
namespace, there's plenty of documentation on it in the MSDN Library:

http://msdn2.microsoft.com/en-us/sys...ualstyles.aspx

Your basic starting point looks to be 2 classes: VisualStyleElement and
VisualStyleRenderer.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

<ra********@gmx.at> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
A glyph IS a symbol / image indeed, BUT a glyph contains the images of
several states, for example in a glyph there are 2 images, one for the
state the button is klicked (and stays clicked), and one for the button
in "normal" state!

I know, i could use 2 images instead, and simply change it in depending
of the button-state for example, but i have A LOT of buttons, and i
often used my glyphs in an other programming language and it all worked
fine....
Kevin Spencer schrieb:
A glyph is a symbol. A symbol is an image. Are you saying that you don't
know how to put an image on a button? Or am I lacking some key piece of
information?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

<ra********@gmx.at> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
> Hi!
>
> I want to do kind of an easy thing, but i don't now HOW:
>
> I have a lot of buttons, i want to place glyphs on them!
> Unfortunately, i didn't found kind of a "glyph-property", so i don't
> know how to do that!
>
> I just thought about writing a class that handles this on my own, but
> it's sounds a bit hard! ;-)
> Furthermore, I'm very surprised that this function isn't natively
> supported?!?
>
> Home somebody can help!
>

Jun 9 '06 #5
Thanks, i'll try it!
Kevin Spencer schrieb:
Ah, my bad, I didn't realize you were talking about the "Glyph" that is part
of the System.Windows.Forms.VisualStyles namespace. I thought you were
talking about the generic term. Sorry.

I must confess I haven't had much opportunity to delve into this namespace
very deeply. It's some pretty deep and complex stuff. It's all linked in
with the XP Operating System, and it's skinning ability. I don't really
think that's what you want. Perhaps instead you could create your own
inherited Button class, your own Glyph class, with several different Bitmaps
to use, and manage the OnPaint method of the Button to draw the surface of
the Button with one of the Bitmaps, depending upon the Button state.

If you're interested in digging into the System.Windows.Forms.VisualStyles
namespace, there's plenty of documentation on it in the MSDN Library:

http://msdn2.microsoft.com/en-us/sys...ualstyles.aspx

Your basic starting point looks to be 2 classes: VisualStyleElement and
VisualStyleRenderer.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

<ra********@gmx.at> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
A glyph IS a symbol / image indeed, BUT a glyph contains the images of
several states, for example in a glyph there are 2 images, one for the
state the button is klicked (and stays clicked), and one for the button
in "normal" state!

I know, i could use 2 images instead, and simply change it in depending
of the button-state for example, but i have A LOT of buttons, and i
often used my glyphs in an other programming language and it all worked
fine....
Kevin Spencer schrieb:
A glyph is a symbol. A symbol is an image. Are you saying that you don't
know how to put an image on a button? Or am I lacking some key piece of
information?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

<ra********@gmx.at> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
> Hi!
>
> I want to do kind of an easy thing, but i don't now HOW:
>
> I have a lot of buttons, i want to place glyphs on them!
> Unfortunately, i didn't found kind of a "glyph-property", so i don't
> know how to do that!
>
> I just thought about writing a class that handles this on my own, but
> it's sounds a bit hard! ;-)
> Furthermore, I'm very surprised that this function isn't natively
> supported?!?
>
> Home somebody can help!
>


Jun 10 '06 #6

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

Similar topics

1
by: Bekkali Hicham | last post by:
hi, i have already used xalan several times with success, but i have a error message that i don't understand, thanks for your help (Emplacement inconnu de l'erreur) Erreur XSLT...
2
by: rawCoder | last post by:
Hi All, I have a *.cer file, a public key of some one and I want to encrypt some thing using this public key. Can someone point me to a sample code for Encrypting some file using...
1
by: Mike | last post by:
When trying to compile (using Visual Web Developer 2005 Express Beta; frameworkv2.0.50215 ) the source code below I get errors (listed below due to the use of ICallBackEventHandler. Ultimately I...
10
by: Christopher Benson-Manica | last post by:
Why can't I use a class destructor in a using declaration: using MyClass::~MyClass; ? -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org ...
1
by: Brian Henry | last post by:
I remember at one point i found a class that drew glyphs for you like the arrows, the grips and such but I can't remember where it is at in the framework now, does anyone know where this is or what...
61
by: Christoph Zwerschke | last post by:
On the page http://wiki.python.org/moin/Python3%2e0Suggestions I noticed an interesting suggestion: "These operators ≤ ≥ ≠ should be added to the language having the following meaning: ...
1
by: Luis Arvayo | last post by:
Hi, I hope this is the correct place for this post. What is your favourite graphic tool for building the glyphs/images/icons on toolbars ?. Photoshop, PaintShop Pro, or ?. I mean 16x16 or...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
12
by: =?Utf-8?B?TWFyaw==?= | last post by:
I modified a C# application from Bob Powell that moves graphics primitives around on the screen into a Vb.NET 2005 application. I want to modify this application so along with moving regular...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.