Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

customise button appearences

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peted - 06 Jun 2007 03:17 GMT
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
Peter Duniho - 06 Jun 2007 07:51 GMT
> im using radio button array with button appearence.
>
[quoted text clipped - 8 lines]
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.