Archive for September, 2009

Adding Linebreaks in C#

Problem: We want to insert linebreak character sequences into a string in C#.  Solution: The platform safe way of doing this is by using the Environment.NewLine property. msg = “An error occurred: ” + Environment.NewLine + e.Message; Composing a string with more than one line break can become really messy, so using string.Format might be a […]

Dynamic Updating of Action Visibilities

Problem: You want to change an action’s visible property and does so in its OnUpdate event handler, but it doesn’t seem to work. Once an action is hidden it can’t seem to become visible again.  Solution: By design Delphi won’t invoke OnUpdate event handlers for actions that have their Visible property set to false. Instead, […]