In my last post, I described how to drag and drop items to reorder a ListView
control. This time I'm going to describe the exact same technique, but this time for the more humble ListBox
.
Entries tagged with 'winforms' Articles and information on C# and .NET development topics
I can't remember when it was I first saw something being dragged with an insertion mark for guidance. Whenever it was, it was a long long time ago and I'm just catching up now.
This article describes how to extend a ListView
control to allow the items within it to be reordered, using insertion guides.
A brief article which describes how to create a definition ruleset to allow better Batch/Command style formatting in the DigitalRune/SharpDevelop Text Editor control.
The ColorPicker Controls have been updated to version 1.0.4.0.
This is a fairly substantial update, with quite a few bug fixes and enhancements to the code. I'll also briefly discuss plans for future updates to the library.
The ImageBox
control is already a versatile little control and I use it for all sorts of tasks. One of the features I recently wanted was to allow users to be able to select a source region, then adjust this as needed. The control already allows you to draw a selection region, but if you need to adjust that ... well, you can't. You can only draw a new region.
This article describes how to extend the ImageBox
to include the ability to resize the selection region. A older demonstration which shows how to drag the selection around has also been incorporated, in a more tidy fashion than the demo.
I recently had a requirement where a user was able to perform an action externally to my application, and my application then had to detect this for processing.
I could of course just had a poller running away in the background to check, but as the requirement also needed user input, why not just wait until the user switched back to my application, then check and deal with accordingly?
This article describes how to intercept the WM_ACTIVATEAPP
message from your C# application and put it to good use.
An article which describes how to add validation support to a TreeView
control that is using custom label edit functionality.
An article which describes a robust yet simple way to have custom text when using the LabelEdit
functionality of a TreeView
and working around the limitations of Windows Forms using C# along with the TVM_GETEDITCONTROL
and WM_SETTEXT
messages.
A short tip which describes how to access the hWnd of the edit component contained within a ComboBox
control via the Win32 API using GetComboBoxInfo
and COMBOBOXINFO
.
Sometimes you may wish to create an application that sits running in the background but doesn't actually display an initial user interface. However, the user can interact with the application and so therefore its not appropriate to be a service. Often such applications are accessible from a system tray icon. Another viable requirement might be for multiple top level windows, for example recent versions of Microsoft Word, where each document has its own application window.
By default however, a normal Windows Form application displays the start-up form which definitely isn't desirable, especially as hiding this form isn't as straightforward as you might expect. Fortunately however, the framework provides us with the ApplicationContext
class that can be used by Application.Run
.
This article describes how to use application contexts to create an application that initially has only a system tray icon to which further functionality can be accessed.