Is it possible to call macros as part of a Visual Studio.NET command line build (or from a batch file)

Yes. You just use the following syntax: devenv.exe {Solution Name} /command {Macro name} Example: devenv.exe ‘myproject.sln’ /command ‘Macros.Syncfusion.Utils.FormatProjectAndClose’ Dev studio will start up, load the solution, run the macro and then terminate. Be sure to check that devenv.exe is available from your command line. Normally, you just have to run VSVARS32.bat to ensure this if you do not already have this in your path.

How can I make a Panel or Label semi-transparent on a Windows Form

You can make a panel or label transparent by specifying the alpha value for the Background color. panel.BackColor = Color.FromArgb(65, 204, 212, 230); In the designer you have to enter these values manually in the edit box. Don’t select the color using the ColorPicker.

How to make my Component add itself to the contained Form’s IContainer list?

You do this inorder to ensure that your component gets disposed along with the contained Form (logical parent). All Form derived classes come with an IContainer field into which many of the .Net components like ImageList and Timer add themselves to. The Form will dispose the contents of this IContainer from within its Dispose. Scenario 1 In order for your Component to get added to this IContainer list, all you have to do is provide a constructor that takes IContainer as the one and only argument. The design-time will discover this constructor automatically and use it to initialize your component. You should then add yourself to the IContainer in the constructor implementation. Note that for this to work your Component should not have a custom TypeConverter that can convert your type to an InstanceDescriptor. Example: public class MyComponent : Component { public MyComponent() { } public MyComponent(IContainer container) { container.Add(this); } } Scenario 2 Your components might have more constructors besides the default constructor and you might have a custom TypeConverter that provides an InstanceDescriptor to let your designer use a non-default constructor for initializing your component in code. In this case, the above approach will not work because you do not have an IContainer-argument only constructor. You now have to recreate what the design-time did for you. You have to provide a custom IDesignerSerializationProvider to do so. The attached ContainerInsertingSerializationProvider class can be used to get the above effect.

How do I draw circles, rectangles, lines and text

Handle the Paint event for your control or form. private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { Graphics g = e.Graphics; Pen pen = new Pen(Color.White, 2); SolidBrush redBrush = new SolidBrush(Color.Red); g.DrawEllipse(pen, 100,150,100,100); g.DrawString(‘Circle’, this.Font, redBrush, 80, 150); g.FillRectangle(redBrush, 140, 35, 20, 40); g.DrawString(‘Rectangle’, this.Font, redBrush, 80, 50); g.DrawLine(pen, 114, 110, 150, 110); g.DrawString(‘Line’, this.Font, redBrush, 80, 104); }

How can I decorate a button face with custom drawing

Subclass Button and add a custom Paint event handler that does you custom drawing. public class MyButton : System.Windows.Forms.Button { public MyButton() { this.Paint += new System.Windows.Forms.PaintEventHandler(this.button1_Paint); } private void button1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { //custom drawing Pen pen2 = new Pen(Color.Red); pen2.Width = 8; e.Graphics.DrawLine(pen2, 7, 4, 7, this.Height – 4); pen2.Width = 1; e.Graphics.DrawEllipse(pen2, this.Width – 16 , 6, 8, 8); } }