10 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Momerath

[B]Expression evaluation using Emit[/B] This class was designed to evaluate simple mathematical expressions. But instead of developing a routine to do the calculating, we use Emit to dynamically build a method that does the math for us. IMPORTANT: This is done with integer math. 7/2*3 = 9, not 10.5 (or …

Member Avatar for Jonathan_13
3
1K
Member Avatar for ddanbe

This is easy! But I admit, it can be rather confusing at first if you also take the old style MenuItem stuff into account. I hope my code is as clear as possible. If not please let me know. To test it, just start a forms application and paste it …

2
6K
Member Avatar for ddanbe

Inheritance with generic types can sometimes be tricky. If you would inherit from a Stack<double>, no problem, but what if you want to keep it as generic as possible? Maybe it's a bad idea, but I wrote something like `class Stacker<T> : Stack<T>` and in Stacker I implemented some arithmetic …

Member Avatar for JOSheaIV
1
770
Member Avatar for veedeoo

The purpose of this class is to be able to create an html form with ease. This is inspired by the form helper in CodeIgniter. This can easily adapt to bootstrap or any css and jquery where id is required. To use this class, we need to include the class …

Member Avatar for veedeoo
3
753
Member Avatar for josverhoeff

Hi, I thought I'd share this with you. If you want all fields on a web form to be emptied of ther initial value (if any) on focus and filled again with the initial value on blur. Works with jquery.

Member Avatar for JJenZz
0
246
Member Avatar for DavidB

Here is a small--complete--program that includes a sub-routine that inputs two matrices and then multiplies them. Notes: * 1) I happen to like taking input from a text file. It eliminates the need to type input from the console, especially when debugging, it prevents the possibility of making typos. * …

Member Avatar for Shellback3
3
2K
Member Avatar for Begginnerdev

After seeing quite a few posts today asking about event handlers for dynamicly created controls, I have decided to give a little example for reference. **Note that you should check [Microsoft's Documentation](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx#inheritanceContinued) ( or research from web ) of any control if you are struggling**

0
509
Member Avatar for Reverend Jim

This code demonstrates how to add controls to a form at run time. The number of rows and columns, the spacing between the controls and the size of the controls are all determined by Consts, but this could easily be changed so that the parameters are user entered. My example …

3
652
Member Avatar for Morten Brendefu

There are many places on internet for great help regarding many things. Proper implementation of really fast routines for sorting data however is not common. I am not claiming these routines to be the fastest around, but their ease of implementation and use may make them welcome. As a thank …

0
244
Member Avatar for sfuo

This program asks for integers from the user and stores them into a multidimensional array that adjusts its size.

Member Avatar for VernonDozier
0
990

The End.