Tag Archives: Windows Forms

Confused by my own design – behaviour through inheritance – How not to achieve it

I wonder, do we all get to that point where our own code, written days or weeks or months or maybe even years back, makes us ask the question, “How the fuck did I do that?” Everything here refers to … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Playing with Glass windows forms in C#

I’ve mentioned before that I’m a little behind the current technology, in that I am still running Windows 7. Since Aero Glass fell by the wayside in favour of what looks like a mobile user interface, this may not be … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Playing with Property Grids in C# – Part 2

In Part 1 we saw how easy it is to use a PropertyGrid control for a user interface with user-configurable options. Here we expand on that a little. Customizing the appearance of an enum I mentioned that we will see … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Playing with Property Grids in C# – Part 1

The PropertyGrid Control is a really handy control, well suited for any UI where the user can configure options, since it can display them in a categorized grid, with a description at the bottom for its selected property. The only … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Still playing with animated Gif images in C#

On this, the last day of my present job (with nothing to do at all), and looking forward to starting the new one, where I may have very little time for blog-writing, to alleviate the boredom I’ve added a bit … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Saving an animated Gif Image with c# in Windows Forms

As mentioned yesterday, you can use the GifEncoder from the Bumpkit class library to save animated Gif image files. In fact, the encoder has no dependencies on the rest of the class library, so I just copied it’s code-file into … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Someone else has already implemented an animated Gif encoder

Sadly, it only shows up on page three of the Google search results for a managed animated Gif image encoder, but it is there! Check out Bumpkit. Now I no longer feel compelled to implement it… Thank goodness. Seriously, the … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Bad code, baaaaad – it hurts my eyes!

There’s a downside to being obsessive, namely, you tend to obsess… Today’s obsession relates to an animated Gif encoder for Windows Forms. Since my PanBox control (PictureBox replacement) used in the application that I have based most of my articles … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Async Tasks and cancellation – Not always so easy

A while ago, I explained briefly how I asynchronously populate and cancel thumbnails in the file browser form of my application. But cancellation turned out to be more difficult than I initially thought. That is, if I changed the current … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Handling standard media keys in your C# media player

Today’s post is probably not news to anyone… But I am sitting at work, doing nothing – bored out of my mind… I (and everyone else in this company) is being retrenched, and today, I am between job interviews. Again, … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Having an async Task yield to the Windows Forms SynchronizationContext

There are issues with calling Task.Yield in Windows Forms, as explained by Stephen Toub on this forum post. Interestingly, I have the opposite problem to the guy complaining there. I have lots of async code, much of which frequently switches … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Showing a form or dialog at a random location

As I wait in dreadful silence to find out whether or not this company will stay in business (and hence whether all of us will be retrenched), I find myself blogging obsessively… the value of these posts is rather dubious, … Continue reading

Posted in Programming | Tagged , | Leave a comment

Updating the Windows Forms UI from async threads

There are many ways to update your UI from async ThreadPool threads. This is just one of them; my preferred way of doing so. These are my general purpose methods, in my base form class, for updating the UI from … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Creating an asynchronous timer

Here’s some interesting code I thought I might share. It’s an asynchronous timer, and allows you, in Windows Forms, to have a simple timer where you specify an interval, a condition, some code to execute on the interval, and optionally … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Some Extension Methods

Extension methods are, in my opinion, one of the best additions to the C# language. I’d been out of track with the various language improvements of the last few years, due to various reasons. (Playing with the language and trying … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Icon Files in c# – Part 2. Writing icon files

Welcome to part 2 of my c# icon file handling code. This one is about my IconFileWriter. Again, the source, for this and a whole bunch of other stuff, is here: RomyView.zip To be honest, I didn’t spend much time … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Icon Files in c# – Part 1. Reading icon files

I’ve written my own icon file reader and icon writer in c# (Windows Forms – it reads the icons into System.Drawing.Icon instances), and since the samples I found on it were sparse and mostly buggy, I’m sharing mine. Again, the … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Custom Color themes in c# update

Just a quick note… The previous post has been updated. It occurred to me that although I explained how the themes are defined and that they get inherited, I neglected to mention how the base form actually applies them. This … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Implementing your own colour themes in a C# Windows Forms application

I now present one way of implementing your own colour themes in an application. (With apologies to Americans… I spell colour in English, not American, except for properties in source code, where I consider color to be correct by convention.) … Continue reading

Posted in Programming | Tagged , , | Leave a comment

A C# Windows Forms application that allows only one instance

A common requirement for application developers is an application that allows only a single instance. I can still remember the first time it came up for me. That was way back in the year 1999 – and I was a … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment