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

Contents of /trunk/EmuXPortal/PlatformControl.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 247 - (show annotations) (download)
Tue Aug 5 07:27:47 2014 UTC (6 years ago) by william
File size: 1165 byte(s)
+ current WIP for flowlayout panel

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 public Image PlatformImage { get { lock (image_lock) { return platformImage.Image; } } set { lock (image_lock) { platformImage.Image = value; } } }
17 public string PlatformName { get { return platformName.Text; } set { platformName.Text = value; } }
18 private void PlatformControl_Load(object sender, EventArgs e)
19 {
20 using (Graphics g = platformName.CreateGraphics())
21 {
22 Size size = g.MeasureString(platformName.Text, platformName.Font).ToSize();
23 platformName.Size = new Size(size.Width + 5, platformName.Size.Height);
24 }
25 }
26
27 public override string ToString()
28 {
29 return string.Format("{0}", PlatformName);
30 }
31 }
32 }

  ViewVC Help
Powered by ViewVC 1.1.22