Our program got an error in some case, and the windows 7 pops up the following window: xxxx has stopped working windows can check online for a solution to the problem. Check online for a solution and close the program Close the program Debug the program When we expand the problem details, we see a [Read More ...]
If you are using Windows 7 or Windows Vista, or Windows Server 2008, you should know the UAC (User Account Control), this is one of significant differences between Windows XP and the newer Windows System. “User Account Control (UAC) determines the privileges of a user. If you are a member of the Built-in Administrators group, [Read More ...]
How to convert seconds number to a string using format “hh:mm: ss”? Method1: int totalTimeLength = 50; string timeString = Convert.ToString(TimeSpan.FromSeconds(totalTimeLength)); Method2: int intHours = (int) (totalTimeLength / 3600); int intMinutes = (int) (totalTimeLength / 60) % 60; int intSeconds = (int)totalTimeLength % 60; string timeString = intHours .ToString() + ":" + intMinutes .ToString() + [Read More ...]
Sometimes in your code you might see a warning like following: Accessing a member on ‘xxxx’ may cause a runtime exception because it is a field of a marshal-by-reference class This warning occurs when you try to call a method, property, or indexer on a member of a class that derives from MarshalByRefObject, and the [Read More ...]
We have a FileStream code using new FileStream: using (FileStream stream = new FileStream(filename, FileMode.Open, FileAccess.Read)) { … } However, we sometimes got the file share kind errors such as “The process cannot access the file … because it is being used by another process.” We searched help information. some cases used the following solution: [Read More ...]
When we use Form.DialogResult in our Windows Form project, we should know it just return a DialogResult, it does NOT call a Close method to close the form automatically. Even you click the Close icon in the top-right corner of the form to close the form. When a form is displayed as a modal dialog [Read More ...]
When you move your mouse point on the screen, there are some information can be shown when you hover a control. How can you do it? In this case we are going to use Windows From, not Web From. This sample is from a similar case on internet: There is a panel, then put some [Read More ...]
In Windows Forms, If you write a KeyDown event method for some keys, such as arrow keys, you might find it doesn’t work, but for other keys like A,B,C,D… it work. The reason is that some Windows Form controls ignore the key press from the TAB key, RETURN key, ESC key, and arrow keys by [Read More ...]
We have a windows form project which used Microsoft Chart Control. The Axis X is DateTime type, Axis Y are double values. We need zoom in/out feature and scroll feature, so we have already the following initial code: chartAreaTrending.CursorX.Interval = 0; chartAreaTrending.CursorY.Interval = 0; chartAreaTrending.CursorX.IsUserSelectionEnabled = true; chartAreaTrending.CursorY.IsUserSelectionEnabled = true; chartAreaTrending.AxisX.ScaleView.Zoomable = true; chartAreaTrending.AxisY.ScaleView.Zoomable = [Read More ...]