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

Annotation of /trunk/EmuXPortal/PlatformControl.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 256 - (hide annotations) (download)
Tue Aug 5 13:21:16 2014 UTC (6 years, 6 months ago) by william
File size: 1260 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 PlatformControl : UserControl
13     {
14 william 137 private object image_lock = new object();
15 william 256 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 william 17 public string PlatformName { get { return platformName.Text; } set { platformName.Text = value; } }
30 william 22 private void PlatformControl_Load(object sender, EventArgs e)
31 william 17 {
32 william 139 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 william 17 }
38     }
39     }

  ViewVC Help
Powered by ViewVC 1.1.22