Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Using an icon resource as a button image
I am using VS2005 in a cli managed application.

I have buttons which load icon files to use as button images.
I use icons so that the images are already transparent when placed.  The IDE
converts these to images and stores them in the form resx file, and I change
them like this:
this->btnReplay->Image = Image::FromFile("ButtonDown.ico");

I want to keep the icons in a resource file and load them from there, but I
am having trouble converting the resource icons to images.  This works OK

System::Drawing::Icon^ aDownIcon = (cli::safe_cast<System::Drawing::Icon^
>(aResourceManager->GetObject("ButtonDown")));

But I can't cast the icon to an Image in order to assign it to the button's
image property.

Is there a simple way to do this?

Steve



Report this thread to moderator Post Follow-up to this message
Old Post
Steve McKewen
04-18-08 10:03 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

VC++ archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:47 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.