Try out this code as an example - public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Button button1; private bool drawline = false; private int radius = 25; private int green = 10; private int red = 10; private int blue = 10; } private void Button_1OK__Click(object sender, System.EventArgs e) { drawline = !drawline; Random r = new Random(100); Int32 x = Int32.Parse(r.Next().ToString().Substring(1,2)); Int32 y = Int32.Parse(r.Next().ToString().Substring(1,3)); if (green < 230) green += 10; if (blue < 230) blue += 10; if (red < 230) red += 10; if (drawline) { System.Drawing.Graphics g = this.CreateGraphics(); Point P = new Point(x,100); Point p1 = new Point (100,y); Color j = Color.FromArgb(red,green,blue); Pen Pe = new Pen(j); g.DrawEllipse(Pe,x,x ,radius, radius); radius += 20; } else { System.Drawing.Graphics g = this.CreateGraphics(); Point P = new Point(x,100); Point p1 = new Point (100,y); Color j = Color.FromArgb(red,green,blue); Pen Pe = new Pen(j); g.DrawEllipse(Pe,y,y ,radius, radius); radius += 20; this.Refresh(); } }
Regards Mahesh
Mahesh Kumar V K
Posts
-
BOOL FLAG Problem in Paint Handler -
Embed a web link inside a messageBox()There is no direct solution to this. What you can do is , write a Customized Message Box (your own Form) which can include this. Regards Mahesh Regards Mahesh
-
Why is my .mdb connection not working?Hello John, The problem is because of the usage of the keyword "Translation" as in OLEDB. If you change the SQL to
String sql = "(SELECT [Translation], PhraseKey FROM [Translation] " + "WHERE languageID = " + language + ")";
the snippet will work fine. Regards Mahesh -
How do I create a new folder programmatically?Example, :suss: Is this what you meant???
System.IO.Directory.CreateDirectory(@"D:\NewFolder\NewSubFolder")
Regards, Mahesh -
SQL Server does not existYes, you can either try
local
or you can even use a.
in the place of Server name as SQL will resolve it to your local SQL Server. In can use have more than one instance of SQL server installed, then pls uselocal\
. For example, I have two instances of SQL Server one SQL Server 2000 which is installed with out any specific instance and and hence local and two SQL Server 2005 Beta named as SQL2K5. When I need to connect to SQL Server 2000, I use.
orlocal
and when I need to connect to SQL Server 2005, I uselocal\SQL2K5
. Hope this helps you. Regards Mahesh