public Form1() { InitializeComponent(); //Create new Instance of UserControl: ImageWithText chamption = new ImageWithText(); //Set Image and Name: chamption.SetChampionName("Ashe"); chamption.SetChampionImage(Properties.Resources.Ashe); //Add to Window: this.Controls.Add(chamption); }
public CounterItem(int x, int y, int w, int h) { AcceptMouseInput = true; WantUpdateSize = false; CanMove = true; X = x; Y = y; Width = w; Height = h; _image = new ImageWithText(); Add(_image); }
public Form1() { InitializeComponent(); //Create new Instance of UserControl: //Simple: ImageWithText champion = new ImageWithText(); //Advanced (pass parameters in construcor): ImageWithText champion = new ImageWithText(Properties.Resources.Ashe, "Ashe"); //Set Image and Name (if not set in constructor:) champion.SetChampionName("Ashe"); champion.SetChampionImage(Properties.Resources.Ashe); //Add to Window: this.Controls.Add(chamption); }
public CounterItem(int x, int y, int w, int h) { AcceptMouseInput = true; WantUpdateSize = false; CanMove = true; CanCloseWithRightClick = false; X = x; Y = y; Width = w; Height = h; _image = new ImageWithText(); Add(_image); ContextMenu = new ContextMenuControl(); ContextMenu.Add(ResGumps.UseObject, Use); ContextMenu.Add(ResGumps.Remove, RemoveItem); }
public CounterItem(int x, int y, int w, int h) { AcceptMouseInput = true; WantUpdateSize = false; CanMove = true; CanCloseWithRightClick = false; X = x; Y = y; Width = w; Height = h; _image = new ImageWithText(); Add(_image); ContextMenu = new ContextMenuControl(); ContextMenu.Add("Use object (Double click)", Use); ContextMenu.Add("Remove (ALT + Right click)", RemoveItem); }
public object ConvertSourceToObject(PublishedPropertyType propertyType, object source, bool preview) { return(ImageWithText.Deserialize(source as string)); }