Tag: WinForms

Mind Mate: Taking Notes with rich text support

Mind Mate: Taking Notes with rich text support

(for background on Mind Mate, click here) Today, I released a new version (0.4) of Mind Mate on GitHub. The chief improvement is the rich text editing capabilities for notes as demonstrated below. When the focus is inside Note Editor, the ribbon switches to following Contextual tab. If the cursor is inside a table, ‘Table…

Read More Read More

MouseHover event in Windows Forms .Net – Generating it repeatedly

MouseHover event in Windows Forms .Net – Generating it repeatedly

MouseHover Event When mouse is stationary for some time over a Windows Forms control, Mouse Hover event is generated. This event is generated only once during mouse’s stay and movement over a control. If mouse leaves and re-enters the control, system again starts tracking for Mouse Hover and will generate the event accordingly. A common…

Read More Read More

Async / Await and SynchronicationContext (C# .Net)

Async / Await and SynchronicationContext (C# .Net)

Following innocuous looking async / await code will cause deadlock. To understand why, lets go into what await does in the above case. 1 Execution starts when the button is clicked and button1_Click event is fired on the UI thread. 2 The method, named LongRunningProcess, is invoked. 3 The lamda expression passed to Task.Run() executes in…

Read More Read More

Creating and Consuming Async methods (C# .Net)

Creating and Consuming Async methods (C# .Net)

The code we want to run asynchronously could either be CPU-bound or IO-bound. CPU-bound code keeps the CPU busy, requiring intensive processing, calculations etc. On the other hand, IO-bound code frees up the CPU while waiting for an IO operation to complete, for instance, get some data from a web service. Both kinds of asynchronous…

Read More Read More

Keeping UI Responsive (C# .Net)

Keeping UI Responsive (C# .Net)

The User Interface (UI) becomes unresponsive when a time taking operation is executed during an event. Consider the following button click event where I have simulated a time taking operation by calling Sleep method. In a real scenario, it could be some processing which produces the result to be shown back on the user interface.…

Read More Read More

Developed Custom .Net Font Dialog

Developed Custom .Net Font Dialog

Developed a Custom FontDialog as an alternative to the standard .Net FontDialog. Key advantage of CustomFontDialog is the full control over look and feel as it is open source. Source and binary files are available at sourceforge. CustomFontDialog avoids ‘This is not a True Type Font’ exception that affects the standard dialog in some cases. Most probably the exception…

Read More Read More

Handle arrow key events in Windows Forms .Net (C#)

Handle arrow key events in Windows Forms .Net (C#)

Pressing of a key is detected and handled in Windows Form using KeyPress, KeyDown or similar events. But these events does not fire when arrow keys are pressed. One way to get around it is to set KeyPreview as true for your Form. In many cases, this also doesn’t work, for instance, when you have…

Read More Read More

Loading and Saving a TreeView control to an XML file using XmlTextWriter and XmlTextReader

Loading and Saving a TreeView control to an XML file using XmlTextWriter and XmlTextReader

Follow the below link to see my article at CodeProject with source code. http://www.codeproject.com/KB/cpp/TreeView_Serializer.aspx It demonstrates how to serialize and de-serialize the contents of System.Windows.Forms.TreeView control from an XML file using forward only, non-cached XmlTextReader and XmlTextWriter.