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

Contents of /trunk/EmuXPortal/PlatformControl.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: 1260 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 PlatformControl : UserControl
13 {
14 private object image_lock = new object();
15 public PlatformControl() { InitializeComponent();
16 platformImage.SizeMode = PictureBoxSizeMode.StretchImage;
17 }
18 public Image PlatformImage
19 {
20 get { lock (image_lock) { return platformImage.Image; } }
21 set
22 {
23 lock (image_lock)
24 {
25 platformImage.Image = value;
26 }
27 }
28 }
29 public string PlatformName { get { return platformName.Text; } set { platformName.Text = value; } }
30 private void PlatformControl_Load(object sender, EventArgs e)
31 {
32 using (Graphics g = platformName.CreateGraphics())
33 {
34 Size size = g.MeasureString(platformName.Text, platformName.Font).ToSize();
35 platformName.Size = new Size(size.Width + 5, platformName.Size.Height);
36 }
37 }
38 }
39 }

  ViewVC Help
Powered by ViewVC 1.1.22