Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Visual Basic Programming

Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-22-2008, 12:03 PM
PascalPro PascalPro is offline
Newbie
 
Join Date: Mar 2008
Posts: 9
Rep Power: 0
PascalPro is on a distinguished road
Default Help with Background Image!

I'm making a digital clock and I could not decide what background picture to use. I collected 4 and I want to be able to change the background from the program. For example using combobox to select the background picture. I experimented with code but could not come up with an answer. Can anyone help me?

I'm using 2005 VB Express Edition

Last edited by PascalPro; 06-22-2008 at 12:27 PM. Reason: Include more Information
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 06-22-2008, 02:00 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,517
Last Blog:
Web slideshow in JavaS...
Rep Power: 46
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: Help with Background Image!

What sort of control is displaying the clock? A label?
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-23-2008, 05:05 AM
chili5's Avatar   
chili5 chili5 is online now
Guru
 
Join Date: Mar 2008
Age: 15
Posts: 3,152
Rep Power: 27
chili5 is a glorious beacon of lightchili5 is a glorious beacon of lightchili5 is a glorious beacon of lightchili5 is a glorious beacon of lightchili5 is a glorious beacon of light
Default Re: Help with Background Image!

Can't you in the combo box specify items and use a click event for each item in the combo box?

Code:
Private Sub cmbBoxitem1 _Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles cmbBoxitem1.Click
Me.background = "filename.ext"
End Sub
Couldn't you do that for each item in the combo box?
__________________
Success is the ability to go from failure to failure without losing your enthusiasm. ~ Winston Churchill
Braingle
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-23-2008, 02:13 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,517
Last Blog:
Web slideshow in JavaS...
Rep Power: 46
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: Help with Background Image!

No. You cannot assign event handlers to individual items in a ComboBox, as far as I know. What you could do is store all the image in a resource file, and then load the picture based on the ComboBox's selected text.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-23-2008, 08:06 PM
adora25 adora25 is offline
Newbie
 
Join Date: Jun 2008
Location: Nashville, TN
Age: 29
Posts: 8
Rep Power: 0
adora25 is on a distinguished road
Default Re: Help with Background Image!

You don't have to assign an event handler to each item in the combo box. Just trap the click event, like he said, and then do a select case on the the selected combo item, or else have the text in the combo actually be the filename. I'd post some code, but I don't have .NET installed at home, sorry.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 06-24-2008, 07:09 AM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,517
Last Blog:
Web slideshow in JavaS...
Rep Power: 46
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: Help with Background Image!

Yeah - some simple string concatenation would be ideal - just grab the ComboBox's Text property, then put it inside a file name.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
box, clock, combo



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make image straight - Photoshop ahsan16 Photoshop Tutorials 56 07-30-2008 03:11 PM
Help with image upload script - need to make an if null statement norbie PHP Forum 7 05-04-2008 09:44 AM
adding an image as the background wholikesforms? easyContact 1 12-06-2007 07:00 AM
Resize Images And Maintain Original Sharpness AfTriX Photoshop Tutorials 7 04-20-2007 09:55 AM


All times are GMT -5. The time now is 05:43 AM.

Contest Stats

Xav ........ 162.68
Sacback ........ 120.05
alearb8 ........ 120.05
tfusion ........ 120
amr2107 ........ 120
d3s!gn ........ 120
Qoolman21 ........ 120
Pillager ........ 108
antihero ........ 106
donfrench ........ 100.05

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 68%

Ads