This snippet will allow you to set a custom color for your ListBox’s selected item background as well as the selected items text color.
First make sure that your ListBox’s
DrawMode is set to
OwnerDrawFixed. This can either by done in the controls properties window or by calling
listBox1.DrawMode = DrawMode.OwnerDrawFixed;
Then we need to handle the ListBox’s
DrawItem event which is where we will be doing the changes to the selected items.
private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
bool isItemSelected = ((e.State & DrawItemState.Selected) == DrawItemState.Selected);
int itemIndex = e.Index;
if (itemIndex >= 0 && itemIndex < listBox1.Items.Count)
Graphics g = e.Graphics;
// Background Color
SolidBrush backgroundColorBrush = new SolidBrush((isItemSelected) ? Color.Red : Color.White);
// Set text color
string itemText = listBox1.Items[itemIndex].ToString();
SolidBrush itemTextColorBrush = (isItemSelected) ? new SolidBrush(Color.White) : new SolidBrush(Color.Black);
g.DrawString(itemText, e.Font, itemTextColorBrush, listBox1.GetItemRectangle(itemIndex).Location);
// Clean up
Plugin-container.exe is a Firefox process that is used to load plugins separately so if a plugin crashes for whatever reason, Firefox won’t be affected by the crash and will stay responsive.
Since there are a lot of people experiencing problems with the plugin-container process I wanted to provide you with two easy methods for disabling it.
In older versions of Firefox it was possible to disable plugin-container.exe by following the steps below.
- Enter about:config in your address bar
- Search for dom.ipc.plugins.enabled
- Set their values to false
Sadly the above method doesn’t seem to work anymore with the newer versions of Firefox. Luckily there is a different workaround which can achieve the same exact result by setting a system or a user environment variable. Follow the steps below if the first method did not work for you.
- Right click on your computer icon on the desktop and click properties
- Go to
Advance system settings
- Click the button called
- Click the “New” button under
System variablesdepending if you want the change to affect all the users on the system or just the one you are currently logged as
- Set the variable name to
MOZ_DISABLE_OOP_PLUGINSand its value to
And that is all you have to do. Now simply restart Firefox and you will notice that the plugin-container.exe process will not be used any more.
Microsoft has released Visual Studio 2012 Update 2 (Visual Studio 2012.2). This update contains numerous features as well as bug fixes and also includes all the changes of the first update which means you can safely skip update 1 if you haven’t already installed it.
For detailed information on what update 2 has to offer visit http://support.microsoft.com/kb/2797912
Visual Studio 2012 Update 3 is now available. Read Visual Studio 2012 Update 3 for more information.
The aim of this tutorial is to teach you how to create a new SQLite database from scratch, create a new table in it, insert and read values from it. This is merely an entry level example to give you an idea on how to start.
First you will need
System.Data.SQLite library from system.data.sqlite.org. Head over to their download section and download the libraries that best suit your need depending on the .NET Framework you want to target and the Windows bit version.
Extract the file and add
System.Data.SQLite.dll as a reference in your project. Keep in mind that
SQLite.Interop.dll also needs to be in your executables directory but doesn’t need to be added as a reference in your project. Moreover, if your application is targeting
Any CPU it is likely that you will get an exception. So make sure to navigate to
Project properties -> Build and set the
Platform target to the bit version of the
System.Data.SQLite.dll binary you have downloaded.
Finally, the snippet below should give you the general idea on the main functions you will need to learn first, mainly
- Creating a file for your database
- Creating a table in your database
- Inserting information in the database
- Retrieving information from the database
Microsoft has recalled one of their recent windows updates yesterday. The update was causing a lot of Windows 7 systems to have a blue screen (
0xc000021a Stop error) or generate event errors with ID 55 and may even cause your system to not be able to boot upon restart.
Microsoft has already removed the update from windows updates list and they are recommending their users to uninstall the update from their systems if they have already installed it. For more information and step by step instructions on how to remove the update visit http://support.microsoft.com/kb/2839011