Total members 11390 |It is currently Sat Dec 20, 2014 8:10 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R

All times are UTC [ DST ]



  change button location in in C#
Sun Jan 04, 2009 1: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
Code:
   
mybutton.Location = new Point(50, 50);


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

Here the overview example
Code:


using System
;
using System.Drawing;
using System.Windows.Forms;
   
class 
newButtonForm
{
     public static 
void Main()
     {
          
Application.Run(new newButton());
     }
     public 
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);
          
grfx.Dispose();
     }
}

 


_________________
Please recommend / share my post if you found it helpful.


Author:
Mastermind
User avatar Posts: 2694
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  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     -  
 Strong tag with button tag     -  
 put image on button in C#     -  
 gel button in flash     -  
 create a web 2.0 button     -  
 disable button     -  
 create button in asp.net     -  

All times are UTC [ DST ]



Topic Tags

C# Forms






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team