Wallpaper Changer

Wallpaper Changer: Wallpaper Genie

One of my hobbies is collecting wallpapers. This hobby inspired me to create an application that can automatically or manually change my computer’s wallpaper. One more thing that inspired me to write this wallpaper changer was the fact that having a wallpaper changing frequently gives an entire different feel to the computer screen, as opposed to having one wallpaper for the entire year. This article will demonstrate how to create an application that changes your wallpapers after a specified period, as well as how to apply the Tile, Center, and Stretch wallpaper styles.

Design

The design is actually quite simple. The main controls you will need to have is a way to view the various wallpapers and their locations on the system; for this, you will use a Treeview. This Treeview displays all the folders as nodes, and then the contents of each particular folder as subnodes. You will need a PictureBox to preview the selection. Further, you also will need eight different Radiobuttons. Three of these Radio buttons will allow you to set the style for the wallpaper (Center, Stretch, Tile); Two Radiobuttons will be used to indicate what mode you want the wallpaper program to perform in. In Automatic mode, the wallpaper and style get applied without you having to do anything. Manual mode will allow you to select the wallpaper along with all the other settings, manually. Finally, the last three Radiobuttons will allow you to select how often you want the wallpaper to change (Daily, Weekly, or Monthly).

Add the following controls with their settings to your form:

Control Property Setting Description
Label Name lblDate Display Today’s Date
  AutoSize True
  Text “” (Empty String)
Label Name lblNumFiles Displays How Many Items In Repository
  AutoSize True
  Text “” (Empty String)
Label Name lblCurrent Displays The Current Wallpaper
  AutoSize True
  Text “” (Empty String)
Treeview Name trGenie Displays All Folders, Sub Folders, and Files, so that you can make a selection
  Sorted True
PictureBox Name picPreview Displays a Thumbnail (smaller picture) of the selected picture
  BorderStyle Fixed3D
PictureBox Name picRealGenie Used to store the selected picture in its original size, so that you still can save the picture without modifying its size
  Visible False
  SizeMode AutoSize
ListBox Name lstFound Used to list all the picture files’ names. Mainly used for the randomizing of the pictures, where you randomly select a listitem that stores the location of the picture
  Visible False
Panel Name Panel1 Holds the Styles radiobuttons
RadioButton (Inside Panel1) Name rdTile To Set Wallpaper Tiling
  Text Tile
RadioButton (Inside Panel1) Name rdCenter To set Wallpaper Centering
  Text Center
RadioButton (Inside Panel1) Name rdStretch To set Stretching of Wallpaper
  Text Stretch
RadioButton Name rdAuto Set Automatic mode
  Text Automatic
RadioButton Name rdManual Set Manual mode
  Text Manual
GroupBox Name gbAuto Stores the Automatic Options controls
  Text Automatic Options
Label (Inside gbAuto) Name Label1 Indicates where to enter Frequency
  Text Frequency:
Textbox (Inside gbAuto) Name txtFreq Allows you to enter the frequency, a number. For example: 1 may mean 1 day, 1 week, or 1 month
  Size 24, 21
RadioButton (Inside gbAuto) Name rdDay Allows you to set Day as a Period
  Text Day(s)
RadioButton (Inside gbAuto) Name rdWeek Allows you to set Week as a Period
  Text Week(s)
RadioButton (Inside gbAuto) Name rdMonth Allows you to set Month as a Period
  Text Month(s)
Button Name cmdEnd To Exit
  Text Exit
  Enabled False
Button Name cmdCancel To Cancel, hide the form
  Text Cancel
  DialogResult Cancel
Button Name cmdApply To Apply the Wallpaper with its settings
  Text Apply
NotifyIcon Name niGenie Allows you to change the settings, when minimised, in Automatic mode
  ContextMenu cmGenie
  Icon Set any icon of your Choice
  Text Wallpaper Genie
  Visible True
ContextMenu Name cmGenie Shows the Menu Items
MenuItem (on cmGenie) Name mnuSettings Allows you to return to the form, to set new settings
  Text Settings
MenuItem (on cmGenie) Name MenuItem1 Seperator
  Text
MenuItem (on cmGenie) Name mnuExit Exit
  Text Exit

Your form’s design should now look more or less like the following picture:

Figure 1

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read