本文整理汇总了C#中System.Windows.Forms.PictureBox.Center方法的典型用法代码示例。如果您正苦于以下问题:C# PictureBox.Center方法的具体用法?C# PictureBox.Center怎么用?C# PictureBox.Center使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.PictureBox
的用法示例。
在下文中一共展示了PictureBox.Center方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FrameForm
public FrameForm(Screen s)
{
InitializeComponent();
/* Set Form Positioning in Secondary Window */
this.Left = s.Bounds.Left;
this.Top = s.Bounds.Top;
this.Size = s.Bounds.Size;
this.WindowState = FormWindowState.Maximized;
/* Create Right Click Menu */
ContextMenu cxtMnu = new ContextMenu();
this.mi_playCtrl = new MenuItem("Pause", mi_playCtrl_Clicked);
cxtMnu.MenuItems.Add(this.mi_playCtrl);
cxtMnu.MenuItems.Add("-");
cxtMnu.MenuItems.Add("Close Frame", delegate(object sndr, EventArgs e) { this.Close(); });
this.ContextMenu = cxtMnu;
/* Load Image Settings */
this.t_imgTransition = new Timer();
this.t_imgTransition.Tick += t_imgTransition_Tick;
LoadSettings();
/* Initiate Picture Boxes */
#if DEBUG
System.Diagnostics.Debug.Print("Initialize picbx_visible");
#endif
img_idx = 0;
picbx_visible = new PictureBox();
picbx_visible.Parent = this;
picbx_visible.Size = this.Size;
picbx_visible.Location = new Point(0, 0);
picbx_visible.Hide();
if (imageList.Length > 0)
picbx_visible.Image = Image.FromFile(imageList[0]);
#if DEBUG
System.Diagnostics.Debug.Print("Initialize picbx_next");
#endif
picbx_next = new PictureBox();
picbx_next.Parent = this;
picbx_next.Size = this.Size;
picbx_next.Location = new Point(0, 0);
picbx_next.Hide();
if (imageList.Length > 1)
picbx_next.Image = Image.FromFile(imageList[1]);
#if DEBUG
System.Diagnostics.Debug.Print(picbx_next.Parent.ToString());
#endif
picbx_visible.FitContainer();
picbx_visible.Center();
picbx_visible.Show();
Properties.Settings.Default.SettingsSaving += delegate(object sndr, CancelEventArgs e){ LoadSettings(); };
/* Start Timer */
this.t_imgTransition.Start();
}