7 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for ddanbe

Wanted to let two forms work together. One form would be the input form and the main form would consume this data. I managed to succeed with the help of a few of my friends here at daniweb., who helped me setup a static form. Just posted a bit of …

Member Avatar for JamesCherrill
1
2K
Member Avatar for ddanbe

I wanted to draw a 5 pointed star in C# and here is how I finally did it. I leave it as an exercise (some hints are given in the code) to work out how I did this. It was fun to do (but a bit hard, my trig is …

Member Avatar for ddanbe
1
4K
Member Avatar for ddanbe

When you want to draw something on a form you need a Graphics object. But a Graphics constructor isn’t public and if that is not enough the Graphics class is also sealed! This means you can’t create a Graphics object via the new keyword nor can you derive from the …

Member Avatar for skatamatic
0
4K
Member Avatar for ddanbe

This is not about a DataGridView or something else, it is just about drawing a simple grid in a form window. Googled a bit but found not much of my liking. A Grid as a BitMap in a PictureBox? Come on! Must have been some of those GUI guys I …

Member Avatar for Wazaah
0
1K
Member Avatar for ddanbe

I mostly use Console or Forms applications in VS for my projects. Did anyone among you ever use an Empty Project when starting a new one? Well, it is as clean as you can get with Visual Studio! The world is at your feet! I use it mainly to test …

Member Avatar for ddanbe
2
956
Member Avatar for ddanbe

Ever wanted to know how to implement running lights? well here is your chance to find out. Open a new Forms application enlarge the Form a bit and drop a Panel and a Timer on it. Add the class ChasingLights to the solution, see code. Implement a form Load, panel …

Member Avatar for Saikalyankumar
5
985
Member Avatar for Diamonddrake

I needed a very simple multi-line label control for a project I was working on, It had very simple requirements. It needed to draw text in any font, in any color, on multiple lines with vertical and horizontal alignment control. So I hacked up this little class. Just as easy …

2
446

The End.