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

Annotation of /trunk/EmuXPortal/GameControl.cs

Parent Directory Parent Directory | Revision Log Revision Log


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

1 william 17 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 william 137 private object image_lock = new object();
15 william 256 public GameControl() { InitializeComponent();
16     gameImage.SizeMode = PictureBoxSizeMode.StretchImage;
17     }
18 william 137 public Image GameImage { get { lock (image_lock) { return gameImage.Image; } } set { lock (image_lock) { gameImage.Image = value; } } }
19 william 22 public string GameName { get { return gameName.Text; } set { gameName.Text = value; } }
20     private void GameControl_Load(object sender, EventArgs e)
21 william 139 {
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 william 17 }
28     }
29     }

  ViewVC Help
Powered by ViewVC 1.1.22