How do I fill a cell with a color after clicking the mouse?

i have a problem. I have a tableLayoutPanel with 2 rows and 2 colums. First colum is empty and in the second colum is something. I know detect a cell which was clicked, but i don't know how can i fill this clicked cell with red collor. Some suggestio

The call of the delegate is not reachable?

using System; namespace _1._75_Using_a_delegate { public class Program { public delegate int Calculate(int x, int y); public int Add(int x, int y) { return x + y; } public int Multiply(int x, int y) { return x * y; } public void UseDelegate() { Calcu

Constraint on DataColumn in C # DataTable?

is it possible to create a value range constraint on a DataTable in C#? I'm dynamically adding a column to a DataTable: this.PrimaryCorrelationMatrix.Columns.Add(sName, typeof(int)); but I'd like all values within this Column to be integers from [0,

Get the image of the video

I am trying to write an application which can access cameras connected to PC, record a video and get an image from the video. I use AForge.NET libraries to access cameras: http://www.aforgenet.com/framework/ I don't know how the event named AForge.Vi

verification of user input submitted via the ajax method

Iv'e created a generic handler (.ashx) to handle some simple input from some dropdowns in a html page. I know I should check the data to make sure it's valid and so I created the following code string ProjectNumber = context.Request.Form["JobNumber&q

A powerful way to read the last line of a file in C #

any idea how to read last or two last lines of a file containing about 30 lines with \n with focus on performance speed? EDIT: something faster than: string[] splitedArray= input.Split('\n'); string lastLine = splitedArray[splitedArray.Length-1]; Usi

HttpUtility.HtmlEncode escaping too much?

In our MVC3 ASP.net project, the HttpUtility.HtmlEncode method seems to be escaping too much characters. Our web pages are served as UTF-8 pages, but still the method escapes characters like ü or the Yen character ¥, even though tese characters are p

edition of packages.config by hand

This question already has an answer here: ASP.NET MVC3: What is the packages.config for? 2 answers i'm a .net/c# noob (long time java/servlet programmer) i inherited an mvc 3 project and have been working on it for about 2 months. just opened package

Access to% appdata% with vb.net

How can you access files in %appdata% through vb.net? e.g. C:\Users\Kuzon\AppData\Roaming\program. How would i access that file but on another windows 7 machine, also how would you do it on windows xp? I believe it is %Application Data%When you're wr

What causes TcpListener Socket Error 10013?

I get error 10013. msdn says its a permission denied error. An attempt was made to access a socket in a way forbidden by its access permissions My app ran fine. I then made a code change and restarted it. I got that error. I suspected i have to reuse

c # Thread issue using Invoke from a background thread

I've got thread, which processes some analytic work. private static void ThreadProc(object obj) { var grid = (DataGridView)obj; foreach (DataGridViewRow row in grid.Rows) { if (Parser.GetPreparationByClientNameForSynonims(row.Cells["Prep"].Value

Can extension methods be applied to interfaces?

Is it possible to apply an extension method to an interface? (C# question) That is for example to achieve the following: create an ITopology interface create an extension method for this interface (e.g. public static int CountNodes(this ITopology top

Using usage to remove nested objects

If I have code with nested objects like this do I need to use the nested using statements to make sure that both the SQLCommand and the SQLConnection objects are disposed of properly like shown below or am I ok if the code that instantiates the SQLCo

Why is there not a .NET Community Process?

I was doing some research into general topics of software engineering and I came across the Java Community Process website: The JCP is the mechanism for developing standard technical specifications for Java technology. Anyone can register for the sit

Return .net Hashtable from a JQuery ajax query

I have a webmethod that returns a Hashtable through a jQuery ajax call along the lines of: $.ajax({ type: "POST", url: webMethod, data: {} contentType: "application/json; charset=utf-8", dataType: "json", success: function(js

Error 10035 on a blocking socket

Does anyone have any idea what could cause a 10035 error (EWOULDBLOCK) when reading on a blocking socket with a timeout? This is under Windows XP using the .NET framework version 3.5 socket library. I've never managed to get this myself, but one of m

Why does the access time to the database change?

For one of my applications, I'm running SQL Server 2005, and I'm running it on localhost. When I'm accessing it though the application it takes it 1-10 seconds to start showing data if I'm accessing it on localhost. However, when I move away from loc

Why is Convert.ToDouble (string) running?

For example, Convert.ToDouble("0.1234567890123456789") = 0.123456789012346 What is the maximum number of significant figures? Couldn't find it in the docs.From MSDN: Precision: 15-16 digits.