What is the Neutral Language setting used for?

I believe it sets the NeutralResourcesLanguageAttribute for the assembly. From the docs: The NeutralResourcesLanguageAttribute informs the ResourceManager of the language used to write the neutral culture’s resources for an assembly, and can also inform the ResourceManager of the assembly to use (either the main assembly or a satellite assembly) to retrieve neutral resources using the … Read more

How to change Panel Border Color

If you don’t want to make a custom panel as suggested in @Sinatr’s answer you can draw the border yourself: private void panel1_Paint(object sender, PaintEventArgs e) { ControlPaint.DrawBorder(e.Graphics, this.panel1.ClientRectangle, Color.DarkBlue, ButtonBorderStyle.Solid); }

WinForm Application UI Hangs during Long-Running Operation

You need to perform the long running operation on a background thread. There are several ways of doing this. You can queue the method call for execution on a thread pool thread (See here): ThreadPool.QueueUserWorkItem(new WaitCallback(YourMethod)); In .NET 4.0 you can use the TaskFactory: Task.Factory.StartNew(() => YourMethod()); And in .NET 4.5 and later, you can … Read more

Creating a background timer to run asynchronously

// Create a 30 min timer timer = new System.Timers.Timer(1800000); // Hook up the Elapsed event for the timer. timer.Elapsed += OnTimedEvent; timer.Enabled = true; … private static void OnTimedEvent(object source, ElapsedEventArgs e) { // do stuff } with the usual caveats of: timer won’t be hugely accurate and might need to GC.KeepAlive(timer) See also: … Read more

How to kill Thread on exit?

If you want the app to exit when the main thread has finished, you can just make the new thread a background thread: Thread t = new Thread(Main.MyThread); t.IsBackground = true; t.Start(); Basically the process will exit when all the foreground threads have exited. Note that this could be bad news if the background thread … Read more

DataGridView first column,first row, is selected on Load, I don’t want this

I was having quite a bit of trouble with this myself. I have a user control with a DataGridView that is populated on application/form load. The selection of the first row seems to happen after databinding is complete and the grid is populated/rendered. The user control load event (and presumably, form load as well) fires … Read more

C# vertical label in a Windows Forms

Labels are easy, all you have to do is override the Paint event and draw the text vertically. Do note that GDI is optimised for Drawing text horizontally. If you rotate text (even if you rotate through multiples of 90 degrees) it will looks notably worse. Perhaps the best thing to do is draw your … Read more

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