[Mono-winforms-list] Changing a background image on a button and minimising to the system tray
Paul
paul at all-the-johnsons.co.uk
Sun Jan 28 13:32:47 EST 2007
Hi,
I'm after a platform-neutral solution here and Google doesn't want to
play nice :-(
I have some background images on a couple of winform buttons (it's for
an early learning package) and periodically they need to change - for
example, if you click on the sun, a timer clicks in and after a set
amount of time, the button image turns to the moon and the timer stops.
The timer works, the button initially has the sun on it. However, I
can't get the image to change to the moon.
I've currently got this
{
sun.Enabled = true;
sun.BackgroundImage =
((System.Drawing.Image)(resources.GetObject("sun.BackgroundImage")));
}
else
{
sun.BackgroundImage =
((System.Drawing.Image)(resources.GetObject("moon.BackgroundImage")));
}
As this is not on the parent, but a child window, I'm getting a problem
in that resources.GetObject cannot be found. I would have thought that
resources would have been something globally available!
(the app currently has 3 forms - AboutBox, Form1 and Form2 - the sun
button is on Form2).
Any idea what I'm missing here?
Secondly, is there a platform neutral method of minimising a winform to
the system tray?
TTFN
Paul
--
"Mmmmmmmm....Shakira geschmiert mit schokolade" sagt Homer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20070128/ffa7d470/attachment.bin
More information about the Mono-winforms-list
mailing list