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

Contents of /trunk/EmuXPortal/GameControl.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: 1114 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 GameControl : UserControl
13 {
14 private object image_lock = new object();
15 public GameControl() { InitializeComponent(); }
16 public Image GameImage { get { lock (image_lock) { return gameImage.Image; } } set { lock (image_lock) { gameImage.Image = value; } } }
17 public string GameName { get { return gameName.Text; } set { gameName.Text = value; } }
18 private void GameControl_Load(object sender, EventArgs e)
19 {
20 using (Graphics g = gameName.CreateGraphics())
21 {
22 Size size = g.MeasureString(gameName.Text, gameName.Font).ToSize();
23 gameName.Size = new Size(size.Width + 5, gameName.Size.Height);
24 }
25 }
26 public override string ToString()
27 {
28 return string.Format("{0}", GameName);
29 }
30 }
31 }

  ViewVC Help
Powered by ViewVC 1.1.22