background preloader

C#

Facebook Twitter

How to Create ProgressBar Column in DataGridView. Introduction A couple of days ago, I was working on a program that allows users to upload multiple files on a server.

How to Create ProgressBar Column in DataGridView

I realized it would be nice to show progress of upload for every file individually. Events Tutorial (C#) This tutorial shows how to declare, invoke, and hook up to events in C#.

Events Tutorial (C#)

Sample Files Further Reading. .net - hooking up events to vertical scroll bar upper arrows and down arrows in data grid view using c# C# - How to inherit constructors. An Introduction to Reflection in C# Environment: C# Introduction In this article, we will see something about reflection in .NET. First, we will see what the System.Reflection namespace will do for .NET developers. Reflection allows the inspection of metadata in a PE file and late binding (run time) to types and their members. The System.Reflection namespace defines the following types to analyze the module's metadata of an assembly: Assembly, Module, Enum, ParameterInfo, MemberInfo, Type, MethodInfo, ConstructorInfo, FieldInfo, EventInfo, and PropertyInfo. ScrollBar.Scroll Event (System.Windows.Forms) Occurs when the scroll box has been moved by either a mouse or keyboard action. public event ScrollEventHandler Scroll private void HandleScroll(Object sender, ScrollEventArgs e) { //Create a graphics object and draw a portion of the image in the PictureBox.

ScrollBar.Scroll Event (System.Windows.Forms)

Threading in C# - Free E-book. Threading in C# Joseph Albahari Last updated: 2011-4-27 Translations: Chinese | Czech | Persian | Russian | Japanese Download PDF Part 1: Getting Started C# supports parallel execution of code through multithreading.

Threading in C# - Free E-book

A C# client program (Console, WPF, or Windows Forms) starts in a single thread created automatically by the CLR and operating system (the “main” thread), and is made multithreaded by creating additional threads. System.Windows.Forms Namespace () ScrollEventHandler Delegate (System.Windows.Forms) Public delegate void ScrollEventHandler( Object sender, ScrollEventArgs e ) The following code example demonstrates the use of this type. .NET Framework.

ScrollEventHandler Delegate (System.Windows.Forms)

Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control. To implement virtual mode You can now test the form to make sure it behaves as expected.

Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control

To test the form Implement a data store that caches values from an external database. The cache should retrieve and discard values as necessary so that it only contains what is necessary for display while consuming a small amount of memory on the client computer. Oop - When should I use static methods in a class and what are the benefits. What is the difference between a Method and a Function? C# - Set Grid Column/Row width/Height dynamically. List Examples. An array does not dynamically resize.

List Examples

A List does. With it, you do not need to manage the size on your own. This type is ideal for linear collections not accessed by keys.Dynamic in size,with many methods,List makes life easier. Array. C# - DataGridView display row header cell. C# - Determine cell location in DataGridView. Adding DataGridViewColumns (lots of them) C# Datagridview Drag & Drop. FillWeight and binding (DataGridView) C# Reverse Stream Reader « Ali Shiravi. My research usually requires me to analyse huge volumes of data.

C# Reverse Stream Reader « Ali Shiravi

In most cases, several runs are required to systematically reduce the dataset and extract the essential information. At the end of each run, certain metadata is required to kick start the next run. In a particular case today, I needed to find the maximum of a variable in a one Terabyte dataset. The no brainer way of doing it is to do a sequential search from top to bottom, but that would take more than 9 hours on my machine. Going through some theory, I quickly figured that the largest value must reside in the last 2 hours of data which resides at the end of the file. Having been used to using StreamReader for most of my text file reading, I did a quick search on something similar to StreamReader which would read the file in reverse order, that is, I needed to read the last line first, and go from there. Obviously, I had to move to another solution, so I decided to read the file in chunks into memory, and parse it there.

C# - How to allow user to drag a dynamically created control at the location of his choice. Override (C#) The override modifier is required to extend or modify the abstract or virtual implementation of an inherited method, property, indexer, or event.

override (C#)

In this example, the Square class must provide an overridden implementation of Area because Area is inherited from the abstract ShapesClass: An override method provides a new implementation of a member that is inherited from a base class. The method that is overridden by an override declaration is known as the overridden base method. The overridden base method must have the same signature as the override method. C# - How to bind list to dataGridView. C# - How to resize datagridview control when form resizes. Retrieving Odd values from a List<string> collection and saving them as GUID c# C# - asp.net Convert CSV string to string[] C# - Dealing with very large datasets & just in time loading. A get or set accessor expected? - Xtreme .NET Talk. List(T) Class (System.Collections.Generic) Represents a strongly typed list of objects that can be accessed by index.

List(T) Class (System.Collections.Generic)

Provides methods to search, sort, and manipulate lists. To browse the .NET Framework source code for this type, see the Reference Source. [SerializableAttribute] public class List<T> : IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable Type Parameters The type of elements in the list.

The List<T> type exposes the following members. The List<T> class uses both an equality comparer and an ordering comparer. IEnumerable(T) Interface (System.Collections.Generic) Exposes the enumerator, which supports a simple iteration over a collection of a specified type. To browse the .NET Framework source code for this type, see the Reference Source. public interface IEnumerable<out T> : IEnumerable Type Parameters out T. C# foreach loop. This article demonstrates how to use foreach loop in C#. C# has a new iteration syntax called foreach, which I believe has been inherited from Visual Basic ( correct me if I am wrong). The foreach syntax is not found in Java. Building a Simple CSV Parser in C# Edit: 2011/04/28 As several people have pointed out, the code in tutorial does not create a true CSV parser. We did, however, publish a followup tutorial that is a fully functional CSV parser. And here it is: C# Tutorial - Using The Built In OLEDB CSV Parser. C# - Why doesn't Console.Writeline, Console.Write work in Visual Studio Express.