Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 1st, 2004, 3:43 PM   #1
patphillips
Newbie
 
Join Date: Oct 2004
Posts: 1
Rep Power: 0 patphillips is on a distinguished road
How do I script a button to change the background image of a form?

I've tried

//formMainMenu.set_BackgroundImage(System.Drawing.Image)(resources.getFromFile("mydocs\Project\GameOver800"));

With GameOver800 being the image name. I've also tried GameOver800.jpg but that does not work.
patphillips is offline   Reply With Quote
Old Oct 1st, 2004, 4:49 PM   #2
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
Probably easier to plug in a littl bit of javascript here since if I recall correctly C# will reload your page on your to make that change. Here is an example of changing it for a whole page:

<html>
<div id="1"><body bg=1.jpg></div>
<input type=button value=whatever onClick="document.GetElementByID( '1' ).innerHTML = '<body bg=2.jpg>';">
</body>
</html>

Get the idea?
__________________
Clifford Matthew Roche &lt;geek@cliffordroche.com&gt;
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC