/[EmuXPortal]/trunk/EmuXPortal/GameControl.cs
ViewVC logotype

Contents of /trunk/EmuXPortal/GameControl.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 256 - (show annotations) (download)
Tue Aug 5 13:21:16 2014 UTC (5 years, 11 months ago) by william
File size: 1069 byte(s)
+ normalize the size of the platform/game controls

1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Drawing;
5 using System.Data;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9
10 namespace EmuXPortal
11 {
12 public partial class GameControl : UserControl
13 {
14 private object image_lock = new object();
15 public GameControl() { InitializeComponent();
16 gameImage.SizeMode = PictureBoxSizeMode.StretchImage;
17 }
18 public Image GameImage { get { lock (image_lock) { return gameImage.Image; } } set { lock (image_lock) { gameImage.Image = value; } } }
19 public string GameName { get { return gameName.Text; } set { gameName.Text = value; } }
20 private void GameControl_Load(object sender, EventArgs e)
21 {
22 using (Graphics g = gameName.CreateGraphics())
23 {
24 Size size = g.MeasureString(gameName.Text, gameName.Font).ToSize();
25 gameName.Size = new Size(size.Width + 5, gameName.Size.Height);
26 }
27 }
28 }
29 }

  ViewVC Help
Powered by ViewVC 1.1.22