Closed Thread
Results 1 to 6 of 6

Thread: Help with Background Image!

  1. #1
    PascalPro is offline Newbie
    Join Date
    Mar 2008
    Posts
    13
    Rep Power
    0

    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 10:27 AM. Reason: Include more Information

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: Help with Background Image!

    What sort of control is displaying the clock? A label?

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  4. #3
    Join Date
    Mar 2008
    Posts
    7,145
    Rep Power
    86

    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?

  5. #4
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    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.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  6. #5
    adora25 is offline Newbie
    Join Date
    Jun 2008
    Location
    Nashville, TN
    Posts
    8
    Rep Power
    0

    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.

  7. #6
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    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.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Image as JButton background
    By mith in forum Java Help
    Replies: 0
    Last Post: 05-13-2011, 07:47 AM
  2. Background-image problems.
    By k4m1k4z1 in forum HTML Programming
    Replies: 5
    Last Post: 07-17-2010, 03:38 PM
  3. Background Image Positioning
    By Davide in forum JavaScript and CSS
    Replies: 6
    Last Post: 05-28-2010, 08:35 AM
  4. background image @ photoshop
    By jwxie518 in forum Website Design
    Replies: 6
    Last Post: 04-19-2009, 07:10 PM
  5. adding an image as the background
    By wholikesforms? in forum easyContact
    Replies: 1
    Last Post: 12-06-2007, 05:00 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts