Total members 9952 | Gratitudes |It is currently Sat Feb 11, 2012 1:27 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Code Snippet
 Code subject: change button location in in C#
PostPosted: Sun Jan 04, 2009 1:00 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2103
Location: Earth
Has thanked: 39 time
Have thanks: 57 time

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

 

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 put image on button in C#  Csharp examples  msi_333  2
 change Font of text in java  Java examples  msi_333  1
 Change the properties of div tag  HTML examples  msi_333  0
 change the direction of text in your page  HTML examples  msi_333  0
 how to change the alignment text in html  HTML examples  msi_333  0

All times are UTC [ DST ]


Users browsing similar codes

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Code Snippet | Next Code Snippet 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






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