Total members 11894 |It is currently Thu Nov 21, 2024 11:09 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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();
     }
}

 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
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     -  
 gel button in flash     -  
 create a web 2.0 button     -  
 disable button     -  
 Nav button size     -  
 create button in asp.net     -  
 Glare button     -  



Topic Tags

C# Forms
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com