Tag Archives: delegates

Add delegates in C#

Delegates are a confusing topic. A delegate is a data type much like int or bool but a delegate represents a method instead of a simple piece of data. Specific delegates represent methods that have specific signatures. For example, a … Continue reading

Posted in syntax | Tagged , , , , , , , , | Leave a comment

Make a standard color palette in C#

The MakeColorPalette method shown below builds an array of PictureBoxes with BackColor properties set to a standard color palette. // Make a color palette on the given parent. private void MakeColorPalette(Control parent, int x, int y, System.EventHandler event_handler) { Color[] … Continue reading

Posted in controls, drawing, graphics | Tagged , , , , , , , , , , , | 1 Comment

Pass a method to another method in C#

This example shows how you can use delegates to pass a method to another method. The example Plot an equation containing two variables in C# shows how to draw a graph of a function even if you don’t really understand … Continue reading

Posted in algorithms, drawing, graphics, mathematics, variables | Tagged , , , , , , , , , , , , , , | 3 Comments