Windows Formshttp://www.geekzilla.co.uk/Innovation Team's dumping grounden-usTue, 10 Jun 2003 04:00:00 GMTTue, 10 Jun 2003 09:41:01 GMTGeekZilla.co.ukeditor@GeekZilla.co.ukwebmaster@GeekZilla.co.uk TraceListener creates huge log files http://www.geekzilla.co.uk/view2C5161FE-783B-4AB7-90EF-C249CB291746.htm TraceListener creates huge log files If you've used the .Net trace listeners, you'll know that they just keep appending to the file specified in the App.Config file, this can lead to some massive log files! Here's a simple TraceListener that logs to a new file for every day. You can configure this by amending the App.Config file: So on the day of this submission this would create a file in e:\logfiles called mylogfile_20060726.log. 26/7/2006 http://www.geekzilla.co.uk/view2C5161FE-783B-4AB7-90EF-C249CB291746.htm Missing App.Path http://www.geekzilla.co.uk/view539AC7FD-E30A-40B2-A427-7402A055BA4E.htm Missing App.Path If you have the need to load resources (XSL stylesheets, images etc etc) at runtime, you may need to know the path of the currently executing code. In VB6 you'd just use good old App.Path, here is the .Net equivalent. #c# string Location = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); 26/7/2006 http://www.geekzilla.co.uk/view539AC7FD-E30A-40B2-A427-7402A055BA4E.htm Updating controls from another thread http://www.geekzilla.co.uk/view903C7C78-57A3-41AF-AC06-D881577A5079.htm Updating form controls from another thread. Form controls, by default, can only be updated by the forms thread. Otherwise an invoke must be used. The example below shows a simple logging function that can be called by threads other than the forms. 14/6/2006 http://www.geekzilla.co.uk/view903C7C78-57A3-41AF-AC06-D881577A5079.htm System tray and balloon tips http://www.geekzilla.co.uk/viewBF3C2DB6-7924-4DD1-B4DE-D024AE31C6C2.htm Balloon Tips from the System Tray You can really easily add system tray function to .NET windows forms by dragging the NotifyIcon object onto your form. You can then use this to display balloon tips from the system tray with the code below: Very easy and it looks nice too :-) 14/6/2006 http://www.geekzilla.co.uk/viewBF3C2DB6-7924-4DD1-B4DE-D024AE31C6C2.htm