Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C# Programming

customise button appearences


im using radio button array with button appearence.

Im just wondering if there is a easy way programtically to enhance the
button look with such things a gradient color fills and effects  and
stuff, without having to resort to using bitmaps or images for
backgrounds ?  Im mostly interested in adding something like a metalic
gradient effect to the buttons and the form background.

Im trying to avoid the use if bitmaps and images becasue i find
frequetly in development the size of my buttons and forms can change
and its a pain to have to resize source images all the time.

Incidently is it possible to perhaps use a vector based image format
that can be resized without pixelisation as a button or form
backgorund.

and can images and bitmaps be embedded into the application when used
for buttons and forms or must they be located in the local app
directory ?

thanks for any advice

Peted

On Tue, 05 Jun 2007 19:17:57 -0700, <Peted> wrote:
> im using radio button array with button appearence.

> Im just wondering if there is a easy way programtically to enhance the
> button look with such things a gradient color fills and effects  and
> stuff, without having to resort to using bitmaps or images for
> backgrounds ?  Im mostly interested in adding something like a metalic
> gradient effect to the buttons and the form background.

> [...]
> Incidently is it possible to perhaps use a vector based image format
> that can be resized without pixelisation as a button or form
> backgorund.

I wish I knew the exact answer to your queston.  :)

However, some thoughts on the general idea...

As far as doing something vector-based, it seems to me that you could  
instead of using a Bitmap, use a Metafile which is essentially a  
vector-based thing.  Or for that matter, I suppose you could override the  
OnPaint() method and just always draw what you want.  As far as drawing  
the kinds of things you're talking about goes, I have not played with it  
yet, but I seem to recall a variety of "fancy" drawing commands from GDI+,  
which I think is supported from .NET.

Also, I haven't had a chance to try to learn about the whole  
"VisualStyles" stuff, but it sure seems to me that this is exactly what  
they exist for.  To provide alternate visual styles for your controls.  I  
could be wrong, but perhaps if you look into that section of the .NET  
Framework classes, there will be some guidance as to how to customize the  
visual style of your control.

> and can images and bitmaps be embedded into the application when used
> for buttons and forms or must they be located in the local app
> directory ?

Well, you can include a bitmap as a resource in the application, which you  
can then use to create a Bitmap instance using the Bitmap.FromResource()  
method.  It would be a little harder to create a Metafile instance from a  
resource, but I believe you could do it by storing the metafile saved as a  
file in the resources as a plain binary resource, then use that to create  
a MemoryStream, then use that with Metafile.FromStream() to create the  
metafile instance.  If there's some other "image" you're thinking of that  
you want to store in the application, you should probably elaborate on  
that.  Other than bitmaps and metafiles, the only other thing that comes  
to mind is icons, and I don't think they are all that applicable here.

Pete

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc