473,382 Members | 1,692 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,382 software developers and data experts.

Win32 Comparing Button.Images

I've assigned three pictures as resources. So I can access them via
Resources.Image1, Resources.Image2, etc

On the buttons I try to do the following

if(Button1.Image == Resources.Image1)

or

if(Button1.Image.Equals(Resources.Image1))

It is always false though. How can I find out if a certain button is using
a certain picture or not?
Nov 16 '05 #1
1 2461
Steve,

There is no easy way to do this. When you use the ==, it is comparing
the object references, in which case, they are not going to be the same (for
the most part).

If anything, you should use an identifier of some sort to indicate what
image is assigned. The only other alternative you have is to do a
comparison of the two images, which would be pretty intensive.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"- Steve -" <se****@foundation.sdsu.edu> wrote in message
news:ue**************@TK2MSFTNGP09.phx.gbl...
I've assigned three pictures as resources. So I can access them via
Resources.Image1, Resources.Image2, etc

On the buttons I try to do the following

if(Button1.Image == Resources.Image1)

or

if(Button1.Image.Equals(Resources.Image1))

It is always false though. How can I find out if a certain button is
using a certain picture or not?

Nov 16 '05 #2

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

Similar topics

9
by: Terrance | last post by:
Good Afternoon: I was hoping if someone could share some light on a problem that I'm facing. When I create a Visual Basic.Net program and I use the XP style for my Window Forms and buttons; if I...
1
by: jphelan | last post by:
I am developping a software program that covers a range of nonprofit organization management needs through various modules. I am looking for images/symbols to use with buttons for navigating with....
2
by: Curtis Wellborn | last post by:
Hey, I have come into a bit of a problem. When Flatsyle is on system it will not show my images that i have set in image list or just in image. Also somethings i have found online do not work...
1
by: Adam Dockter | last post by:
I have a couple questions about comparing images. I notice the imagelist collection of images doesn't provide any comparison of images, and the System.Drawing.Image.Equal function will not compare...
9
by: tshad | last post by:
Is there a way to use your own image in place of the automatic one that ASP uses when doing editing in your DataGrid pages? We already have a style of button we are using and would like to be...
1
by: Jessica Weiner | last post by:
I need buttons in my application that have a jpeg skin. However, I dont want to include the jpg file in my distribution package. How can I incorporate the jpg into c# code? Maybe by converting it...
6
by: lanwrangler | last post by:
I know it's a long shot but does anyone have any pointers to generic algorithms - or, even better, Python code - for comparing images and computing a value for the "difference" between them? ...
5
by: John Randall | last post by:
Anybody got some sample code showing how to create a word doc and insert text plus images, such as .gif or jpg files? I'm new to Win32::OLE. Thanks in advance.
9
by: William Krick | last post by:
I'm currently using the following custom Stylish style sheet in Firefox 2.0.0.11... *{ color: black !important ; background: none !important; background- color: white !important } a:link {...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.