***** Programmer *****
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.
***** Programmer *****

Học lập trình từ căn bản

Tìm kiếm
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Tuyên mộ thành viên
Button 4- How to: Create a Non-Rectangular Button EmptyWed Oct 24, 2012 5:28 am by quangvuspkt

» Bai tap Java can ban (Phan III )
Button 4- How to: Create a Non-Rectangular Button EmptySat Sep 15, 2012 4:11 am by tsuyngam

» Bai tap Java can ban (Phan I )
Button 4- How to: Create a Non-Rectangular Button EmptySat Sep 15, 2012 4:08 am by tsuyngam

» Một số bài tập C# căn bản
Button 4- How to: Create a Non-Rectangular Button EmptyThu Dec 15, 2011 1:58 pm by nguyenhoduykhang

» Xem thông tin máy tính bằng c#
Button 4- How to: Create a Non-Rectangular Button EmptyTue Nov 08, 2011 8:19 am by namcongtu288

» My First Browser Tree Program in VB.NET
Button 4- How to: Create a Non-Rectangular Button EmptyFri Aug 12, 2011 5:50 pm by kimthaohg85

» Giúp em bài C++ này với
Button 4- How to: Create a Non-Rectangular Button EmptySun Jul 31, 2011 12:19 pm by kubin

» GIUP DO XAY DUNG BO GO TIENG VIET CODE C#
Button 4- How to: Create a Non-Rectangular Button EmptySun Jul 24, 2011 8:40 pm by phonui82

» CHÀO TẤT CẢ CÁC THÀNH VIÊN TRONG DIỄN ĐÀN
Button 4- How to: Create a Non-Rectangular Button EmptyTue Jul 19, 2011 9:28 am by phonui82

Đăng Nhập

Quên mật khẩu



April 2024
MonTueWedThuFriSatSun
1234567
891011121314
15161718192021
22232425262728
2930     

Calendar Calendar


You are not connected. Please login or register

Button 4- How to: Create a Non-Rectangular Button

Go down  Thông điệp [Trang 1 trong tổng số 1 trang]

Tesulakata

Tesulakata
Thành viên
Thành viên

How to: Create a Non-Rectangular Button
This example demonstrates how to create a button that is a different shape from the standard rectangular button. The code adds a button in the shape of a circle to the form and creates an event handler that displays a message when the circle is clicked.

https://programmer.4umer.com

Tesulakata

Tesulakata
Thành viên
Thành viên

public Form2()
{
//
// Required for Windows Form Designer support.
//
InitializeComponent();
// Initialize the user-defined button,
// including defining handler for Click message,
// location and size.
myButtonObject myButton = new myButtonObject();
EventHandler myHandler = new EventHandler(myButton_Click);
myButton.Click += myHandler;
myButton.Location = new System.Drawing.Point(20, 20);
myButton.Size = new System.Drawing.Size(101, 101);
this.Controls.Add(myButton);
}
public class myButtonObject : UserControl
{
// Draw the new button.
protected override void OnPaint(PaintEventArgs e)
{
Graphics graphics = e.Graphics;
Pen myPen = new Pen(Color.Black);
// Draw the button in the form of a circle
graphics.DrawEllipse(myPen, 0, 0, 100, 100);
myPen.Dispose();
}
}
// Handler for the click message.
void myButton_Click(Object sender, System.EventArgs e)
{
MessageBox.Show("Click");
}

https://programmer.4umer.com

Về Đầu Trang  Thông điệp [Trang 1 trong tổng số 1 trang]

Permissions in this forum:
Bạn không có quyền trả lời bài viết