Posts tagged ‘C#’

Mobile Development: A binary clock for the taskbar


do you also like the binary watches from IO?

OK, I like them and was inspired to make some binary clock for the Windows Mobile taskbar.

The time shown here is 14:23 displayed as binary dots. The top row (red) shows the hours in 24h format. The second row shows the minutes and the bottom row shows the seconds.

What you see here is encoded in binary:

01110   is equal to 0*16 1*8 1*4 1*2 0*1 = 8 + 4 + 2 = 14
10111   is equal to 1*16 0*8 1*4 1*2 1*1 = 16 + 4 + 2 + 1 = 23
00100   is equal to 0*16 0*8 1*4 0*2 0*1 = 4 = 4

So you see, it shows the time is 14:23:04

Continue reading ‘Mobile Development: A binary clock for the taskbar’ »

Mobile Development: Easy to use background thread with GUI update

Although there are well know ways to update the GUI from a background thread not running in the GUI thread, I looked for an easiest to use solution. After some experiments I got a background thread class that is very easy to use. No BeginInvoke or Control.Invoke needed any more to update a GUI element.

The final solution uses a MessageWindow inside a control based class with a worker thread. As the control and the MessageWindow is part of the GUI thread, there is no need to use Invokes.

Inside the thread I use SendMessage to transfer background thread informations to the control, which then fires an event you can subscribe in the GUI thread.

The test app attached shows three threads running independently and all update the GUI frequently without blocking the GUI.

Here is my try to visualize my idea and solution

Continue reading ‘Mobile Development: Easy to use background thread with GUI update’ »