How to close a MessageBox after several seconds

Try the following approach: AutoClosingMessageBox.Show(“Text”, “Caption”, 1000); Where the AutoClosingMessageBox class implemented as following: public class AutoClosingMessageBox { System.Threading.Timer _timeoutTimer; string _caption; AutoClosingMessageBox(string text, string caption, int timeout) { _caption = caption; _timeoutTimer = new System.Threading.Timer(OnTimerElapsed, null, timeout, System.Threading.Timeout.Infinite); using(_timeoutTimer) MessageBox.Show(text, caption); } public static void Show(string text, string caption, int timeout) { new AutoClosingMessageBox(text, … Read more

Displaying tooltip over a disabled control

you can show the tooltip only once when mouse hits the disbled control and then hide it when mouse leaves it. Pls, take a look at the code below, it should be showing a tooltip message for all the disabled controls on the form private ToolTip _toolTip = new ToolTip(); private Control _currentToolTipControl = null; … Read more

How to Fix the Memory Leak in IE WebBrowser Control?

my app was also constantly consuming memory when navigating, and not releasing anymore. i fount the solution for me here: http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/thread/88c21427-e765-46e8-833d-6021ef79e0c8 for completeness ill post the notable excerpt: — in class definition [DllImport(“KERNEL32.DLL”, EntryPoint = “SetProcessWorkingSetSize”, SetLastError = true, CallingConvention = CallingConvention.StdCall)] internal static extern bool SetProcessWorkingSetSize(IntPtr pProcess, int dwMinimumWorkingSetSize, int dwMaximumWorkingSetSize); [DllImport(“KERNEL32.DLL”, EntryPoint = … Read more

How to get Windows native look for the .NET TreeView?

You need to P/Invoke to call SetWindowTheme passing the window handle of the tree and use “explorer” as the theme. Paste the following code into a new class in your project, compile, and use this custom control instead of the built-in TreeView control. C#: public class NativeTreeView : System.Windows.Forms.TreeView { [DllImport(“uxtheme.dll”, CharSet = CharSet.Unicode)] private … Read more

Getting “” at the beginning of my XML File after save() [duplicate]

It is the UTF-8 BOM, which is actually discouraged by the Unicode standard: http://www.unicode.org/versions/Unicode5.0.0/ch02.pdf Use of a BOM is neither required nor recommended for UTF-8, but may be encountered in contexts where UTF-8 data is converted from other encoding forms that use a BOM or where the BOM is used as a UTF-8 signature You … Read more

winforms html editor [closed]

You can use the WebBrowser control in design mode with a second WebBrowser control set in view mode. In order to put the WebBrowser control in design mode, you can use the following code. This code is a super stripped down version of a WYSIWYG editor for one of our software products. Simply create a … Read more

How to increase the timeout period of web service in asp.net?

1 – You can set a timeout in your application : var client = new YourServiceReference.YourServiceClass(); client.Timeout = 60; // or -1 for infinite It is in milliseconds. 2 – Also you can increase timeout value in httpruntime tag in web/app.config : <configuration> <system.web> <httpRuntime executionTimeout=”<<**seconds**>>” /> … </system.web> </configuration> For ASP.NET applications, the Timeout … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)