/// <summary> /// Called when graphics resources need to be loaded. /// /// Use this for the usage of : /// - creation of the internal embedded controls. /// - setting of the variables and resources in this control /// - to load any game-specific graphics resources /// - take over the config width and height and use it into State /// - overriding how this item looks like , by settings its texture or theme /// /// Call base.LoadContent before you do your override code, this will cause : /// - State.SourceRectangle to be reset to the Config.Size /// </summary> public override void LoadContent() { base.LoadContent(); // min button MinButton.ConfigText = "<"; MinButton.Config.Width = Config.Height; MinButton.Config.Height = Config.Height; MinButton.LoadContent(); // max button MaxButton.ConfigText = ">"; MaxButton.Config.Width = Config.Height; MaxButton.Config.Height = Config.Height; MaxButton.Config.PositionX = Config.Width - MaxButton.Config.Width; MaxButton.LoadContent(); // indicator this.ScrollIndicator = new Button(Name + "-indicator"); this.RedrawSize(); this.RedrawPosition(); this.AddControl(this.ScrollIndicator); ScrollIndicator.LoadContent(); this.SetVisibility(); }
private void ClientForm_Resize(object sender, EventArgs e) { switch (this.WindowState) { case FormWindowState.Normal: { MaxButton.Show(); RestoreButton.Hide(); break; } case FormWindowState.Maximized: { MaxButton.Hide(); RestoreButton.Show(); break; } case FormWindowState.Minimized: { break; } } }