38 lines
954 B
C#
38 lines
954 B
C#
|
Set control border style
|
||
|
|
||
|
using System;
|
||
|
using System.Windows.Forms;
|
||
|
|
||
|
public class MyForm : System.Windows.Forms.Form
|
||
|
{
|
||
|
private Button btnLoad;
|
||
|
private PictureBox imgPhoto;
|
||
|
|
||
|
public MyForm()
|
||
|
{
|
||
|
this.Text = "www.happycodings.com";
|
||
|
|
||
|
btnLoad = new Button();
|
||
|
btnLoad.Text = "&Load";
|
||
|
btnLoad.Left = 10;
|
||
|
btnLoad.Top = 10;
|
||
|
|
||
|
imgPhoto = new PictureBox();
|
||
|
imgPhoto.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||
|
imgPhoto.Width = this.Width / 2;
|
||
|
imgPhoto.Height = this.Height / 2;
|
||
|
imgPhoto.Left = (this.Width - imgPhoto.Width) / 2;
|
||
|
imgPhoto.Top = (this.Height - imgPhoto.Height) / 2;
|
||
|
|
||
|
this.Controls.Add(btnLoad);
|
||
|
this.Controls.Add(imgPhoto);
|
||
|
}
|
||
|
|
||
|
|
||
|
public static void Main()
|
||
|
{
|
||
|
Application.Run(new MyForm());
|
||
|
}
|
||
|
}
|
||
|
|