Copy one directory to another

- Posted in Coding by

Introducing the CopyTo method, which faithfully copies one directory's contents to another directory. The method listing is on Github here.

And here is a sample program demonstrating its usage.

Moving a form programmatically using C#

- Posted in Coding by

Shows how we can access Form1's default TextBox (textBox1) from within another class, by passing into that other class's constructor a refence to Form1. We create public properties for the form's 'textBox1' TextBox, because the textbox is private to Form1 (see the declaration in Form1Designer.cs, which looks like this):

private System.Windows.Forms.TextBox textBox1;

By passing a reference to Form1 into the other class's constructor, and then utilizing the properties we created, we can alter Form1's textbox's .Width and .Text properties from another class: