This version of the wallpaper changer is based on my original code that was written in VB.NET. I chose to re-write this program mainly because the original code was horrible and I’ve been wanting to move a lot of my older programs over to C#.
The main purpose for this program was to be used in windows XP since this wasn’t a feature that it had. It never really worked in a way that I wanted it to (originally) so this re-write corrects a lot of the issues that the original had. I decided to post it on github with the hopes that someone may find it useful in some way.
The code as is isn’t complete. There are some changes I plan on making (currently it just does jpgs) but as the code is , it works.
The code can be found below:
Sys Clock is a simple program I wrote to show the current day of the week, Time, and full date. I came up with the idea for this while playing a game that did not display what time it currently was. Since I played in full screen windowed, an always on top program worked perfectly for this situation. The window for the program can either be locked in place or moved around based on user input.
Source Code can be found on my github.
While working on some programs dealing with multiple forms, I ran into an issue where I would end up with more than 1 instance of the same form being created. This came up when using a form as an MDI parent and then trying to open another form as a child to the parent form. When the child form would open, you could continue opening new instances of that same form while the one prior was still opened.
The code below will check to see if it already exists and if it doesn’t assign the new form as a child to the mdi parent form and open it.
//Code that handles Child forms. May be adding more code to this down the road for customization.
//No need to write the same code for every form
private void CreateMDIChild(Form childForm)
//Checks if child form already exists. Only open if it does not exist in the collection
FormCollection allForms = Application.OpenForms;
bool formOpened = false; //Assume that this form does not already exist
foreach (Form frm in allForms)
if (frm.Name == childForm.Name)
//Tried to open form here however it throws an error about the collection being modified. So we create a bool and if the form exists
//set it to true
formOpened = true;
//As long as formOpened is false we can open the new form as a child form to the parent
if (formOpened == false)
childForm.MdiParent = this;
Using the method
private void loginRegisterToolStripMenuItem_Click(object sender, EventArgs e)
Someone was asking how to do multi-threading in the shoutbox and my original example didn’t work because of cross-threads. This basically means I couldn’t set the value of a control within a thread since it’s considered a different process. Well I did manage to get it to work and I figured I’d post the code here. I will also include the source code both both the VB.net and C# versions below.
Public Class Form1
Dim Max As Double = 600000
Dim i As Integer = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ProgressBar1.Maximum = Max
Dim threadFill As Thread = New Thread(AddressOf Thread_FillProgressbar)
Private Sub Thread_FillProgressbar()
For i = 0 To Max
Private Sub AccessControl()
If Me.InvokeRequired Then
Me.Invoke(New MethodInvoker(AddressOf AccessControl))
ProgressBar1.Value = i
ShowInTaskbar = True
public partial class Form1 : Form
int Max = 60000;
int i = 0;
private void Form1_Load(object sender, EventArgs e)
progressBar1.Maximum = Max;
Thread threadFill = new
private void Thread_FillProgressBar()
for (i = 0; i <= Max; i++)
private void accessControl()
progressBar1.Value = i;
ShowInTaskbar = true;