change button location in in C#

Sun Jan 04, 2009 12:00 pm

This simple code all you show to you how to change the place of your button on the forum,
by changing the line
mybutton.Location = new Point(50, 50);

Here the button will be set on the point 50,50 on your form .

Here the overview example

using System
using System.Drawing;
using System.Windows.Forms;
     public static 
void Main()
Application.Run(new newButton());
Text "Button";
Button mybutton   = new Button();
mybutton.Parent   this;
mybutton.Text     "Ok";
mybutton.Location = new Point(5050);
mybutton.Click   += new EventHandler(ButtonActionClick);
void ButtonActionClick(object objEventArgs ea)
Graphics grfx   CreateGraphics();
Point    placeText Point.Empty;
string   stringaction    "Clicked";
grfx.DrawString(stringactionFont, new SolidBrush(ForeColor), placeText);


  Related Posts  to : change button location in in C#
 location of a package statement within a source code file     -  
 Test Lead (HealthCare BCBS Exp) / Location: Owings Mills     -  
 Convert link and button to custom button with good style     -  
 Gel Button     -  
 Nav button size     -  
 create button in     -  
 Glare button     -  
 create web button     -  
 Strong tag with button tag     -  
 put image on button in C#     -  

Topic Tags

C# Forms