public static void DeleteAccount(MetroFramework.Controls.MetroTile tile) { if (tile == null) { return; } for (int index = 0; index < List_PlasticCards.Count; index++) { if (List_PlasticCards[index].Name == tile.Text) { List_PlasticCards.RemoveAt(index); for (int XmlChildIndex = 0; XmlChildIndex < XmlAccountsDocument.DocumentElement.ChildNodes.Count; XmlChildIndex++) { if (XmlAccountsDocument.DocumentElement.ChildNodes[XmlChildIndex].Attributes["type"].Value == "PlasticCard" && XmlAccountsDocument.DocumentElement.ChildNodes[XmlChildIndex].ChildNodes[0].InnerText == tile.Text) { XmlAccountsDocument.DocumentElement.RemoveChild(XmlAccountsDocument.DocumentElement.ChildNodes[XmlChildIndex]); break; } } break; } } TileManager.PlasticCardsTab.DeleteTile(tile); }
private void CreateNewArtikliButtons() { using (var db = new KaficDB()) { var upit = from a in db.Artikl where a.ID_vrsta_artikla == odabranaVrsta select a; for (int i = 1; i <= brArtikla; i++) { foreach (var artikli in upit.ToList <Artikl>()) { if (artikli.ID_artikl == i) { MetroFramework.Controls.MetroTile b = new MetroFramework.Controls.MetroTile(); b.Name = "btn" + artikli.Naziv.ToString(); b.Text = artikli.Naziv + Environment.NewLine + artikli.Cijena.ToString() + " kn"; b.Size = new Size(92, 68); fpnlArtikli.Controls.Add(b); b.Click += delegate { listaArtikla.Add(artikli); StaticVarijable.ukupanIznos += double.Parse(artikli.Cijena.ToString()); lblIznos.Text = StaticVarijable.ukupanIznos.ToString(); artiklBindingSource.DataSource = listaArtikla; metroGrid1.DataSource = artiklBindingSource; }; } } } } }
public CustomTile(MainForm mainForm, MetroTile tile, int tileNum, string serializedTileInfo) { this.mainForm = mainForm; this.tile = tile; this.tileNum = tileNum; this.serializedTileInfo = serializedTileInfo; tile.Click += (s, e) => { if (path != "") { Process.Start(path); } else { // no value defined for this custom tile. CustomTileForm ctf = new CustomTileForm(mainForm, this); ctf.ShowDialog(); } }; if (serializedTileInfo == "") { return; } var serializedTileInfoArr = serializedTileInfo.Split(','); for (int i = 0; i < serializedTileInfoArr.Length; i++) { if (i==0) { path = serializedTileInfoArr[0]; if (path == null) { return; } setPath(path); } else if (i == 1) { tile.Text = serializedTileInfoArr[1]; } } }
public CustomTileForm(MainForm mainForm, CustomTile customTile) { this.mainForm = mainForm; this.customTile = customTile; tileNum = customTile.tileNum; tile = customTile.tile; InitializeComponent(); folderRadioButton.Checked = true; }
public static PlasticCard GetPlasticCardByTile(MetroFramework.Controls.MetroTile tile) { if (tile == null) { throw new Exception("Tile is null"); } for (int index = 0; index < List_PlasticCards.Count; index++) { if (List_PlasticCards[index].Name == tile.Text) { return(List_PlasticCards[index]); } } throw new Exception("Tile not found"); }
public void InitialTable() { for (int i = 0; i < 10; i++) { for (int j = 0; j < 20; j++) { MetroTileA[i, j] = new MetroTile(); MetroTile temp = MetroTileA[i, j]; temp.ActiveControl = null; temp.Size = new System.Drawing.Size(20, 20); temp.TabIndex = i * 10 + j; temp.Tag = new int[] { i, j }; temp.Cursor = System.Windows.Forms.Cursors.Hand; temp.Click += new System.EventHandler(this.MetroTile_Click); TableLayOut.Controls.Add(temp); } } }
public void generateGreyScale(int numOfTiles, String[] letters) { letterTiles = new MetroTile[numOfTiles]; int counter = 0; int posX = 30; int posY = 0; //Generate tiles for (int i = 0; i < letterTiles.Length; i++) { letterTiles[i] = new MetroTile(); } while (counter < numOfTiles) { letterTiles[counter].Tag = counter + 1; letterTiles[counter].Height = 90; letterTiles[counter].Width = 90; if (counter % 6 == 0) { posX = 30; posY += 120; } letterTiles[counter].Left = posX; letterTiles[counter].Top = posY; tilePanel.Controls.Add(letterTiles[counter]); posX = posX + letterTiles[counter].Width + 30; letterTiles[counter].TileTextFontSize = MetroTileTextSize.Tall; letterTiles[counter].TileTextFontWeight = MetroTileTextWeight.Bold; letterTiles[counter].Name = letters[counter]; letterTiles[counter].Text = letters[counter]; if (updateLevelTile(MainForm2.kidName, letterTiles[counter].Text)) { letterTiles[counter].Text += "\nDONE!"; } letterTiles[counter].TextAlign = ContentAlignment.MiddleCenter; letterTiles[counter].Style = MetroColorStyle.Silver; letterTiles[counter].Click += new System.EventHandler(ButtonEventHandler); counter++; } }
public frmLegend(List <string> _textList, List <MetroColorStyle> _styleList) : this() { if (_textList != null && _textList.Count > 0) { for (int i = 0; i < _textList.Count; i++) { string text = _textList[i]; MetroColorStyle style = _styleList[i]; MetroTile metroTile1 = new MetroFramework.Controls.MetroTile(); Controls.Add(metroTile1); metroTile1.ActiveControl = null; metroTile1.Location = new System.Drawing.Point(15, first_tile_top + i * tile_top_step); metroTile1.MainText = ""; metroTile1.Name = "metroTile" + i.ToString(); metroTile1.Size = new System.Drawing.Size(85, 23); metroTile1.Style = style; metroTile1.StyleManager = null; metroTile1.TabIndex = 0; metroTile1.Text = ""; metroTile1.Theme = MetroFramework.MetroThemeStyle.Light; metroTile1.TileCount = 0; System.Windows.Forms.Label label1 = new System.Windows.Forms.Label(); this.Controls.Add(label1); label1.AutoSize = true; label1.ForeColor = System.Drawing.Color.White; label1.Location = new System.Drawing.Point(108, first_label_top + i * tile_top_step); label1.Name = "label" + i.ToString(); label1.Size = new System.Drawing.Size(95, 12); label1.TabIndex = 3; label1.Text = text; } } }
private void BindToDataSource() { Text = _dataSource.Name; if (!string.IsNullOrEmpty(_dataSource.Poster)) { poster.Image = Image.FromFile(Data.Settings.PosterPath + _dataSource.Poster); } tbDescription.Text = _dataSource.Description; var seasonsList = new SortedList<int, MetroTile>(); _dataSource.Seasons.ForEach(season => { var seasonTile = new MetroTile() { Text = season.SeasonNumber.ToString(), TextAlign = ContentAlignment.MiddleCenter, Size = new Size(30, 30), StyleManager = StyleManager }; seasonTile.Click += SeasonTileClicked; seasonsList.Add(season.SeasonNumber, seasonTile); }); foreach (var item in seasonsList) { panelSeasons.Controls.Add(item.Value); } }
//generates tiles public void generateTiles(int numOfTiles, String[] letters) { letterTiles = new MetroTile[numOfTiles]; int counter = 0; int posX = 30; int posY = 0; //Generate tiles for (int i = 0; i < letterTiles.Length; i++) { letterTiles[i] = new MetroTile(); } int colorCount = 0; while (counter < numOfTiles) { letterTiles[counter].Tag = counter + 1; letterTiles[counter].Height = 90; letterTiles[counter].Width = 90; if (counter % 6 == 0) { posX = 30; posY += 120; } letterTiles[counter].Left = posX; letterTiles[counter].Top = posY; tilePanel.Controls.Add(letterTiles[counter]); posX = posX + letterTiles[counter].Width + 30; letterTiles[counter].TileTextFontSize = MetroTileTextSize.Tall; letterTiles[counter].TileTextFontWeight = MetroTileTextWeight.Bold; letterTiles[counter].Name = letters[counter]; letterTiles[counter].Text = letters[counter]; if (updateLevelTile(kidName, letterTiles[counter].Text)) { letterTiles[counter].Text += "\nDONE!"; } letterTiles[counter].TextAlign = ContentAlignment.MiddleCenter; //int next = Random.Next(10, 12); //letterTiles[counter].Style = (MetroColorStyle)next; if (colorCount == 0) { letterTiles[counter].Style = MetroColorStyle.Red; colorCount++; } else if (colorCount == 1) { letterTiles[counter].Style = MetroColorStyle.Yellow; colorCount++; } else if (colorCount == 2) { letterTiles[counter].Style = MetroColorStyle.Orange; colorCount++; } else if (colorCount == 3) { letterTiles[counter].Style = MetroColorStyle.Green; colorCount++; } else if (colorCount == 4) { colorCount = 0; } letterTiles[counter].Click += new System.EventHandler(ButtonEventHandler); counter++; } }
public MainForm(String filename) { InitializeComponent(); getData(connStr, "spelltable_db"); getData(connStr, "image_db"); getData(connStr, "audio_db"); getData(connStr, "flash_db"); getData(connStr, "wordbank_image"); getData(connStr, "wordbank_audio"); r = readTile; w = writeTile; e = exitTile; //MetroTile "look and feel" settings //----------------------------------------------------------// r.TileTextFontSize = MetroTileTextSize.Tall; r.TileTextFontWeight = MetroTileTextWeight.Bold; w.TileTextFontSize = MetroTileTextSize.Tall; w.TileTextFontWeight = MetroTileTextWeight.Bold; e.TileTextFontSize = MetroTileTextSize.Tall; e.TileTextFontWeight = MetroTileTextWeight.Bold; mathTile.TileTextFontSize = MetroTileTextSize.Tall; mathTile.TileTextFontWeight = MetroTileTextWeight.Bold; wordBankBtn.TileTextFontSize = MetroTileTextSize.Tall; wordBankBtn.TileTextFontWeight = MetroTileTextWeight.Bold; spellTile.TileTextFontSize = MetroTileTextSize.Tall; spellTile.TileTextFontWeight = MetroTileTextWeight.Bold; guessGameTile.TileTextFontSize = MetroTileTextSize.Tall; guessGameTile.TileTextFontWeight = MetroTileTextWeight.Bold; viewProgressBtn.TileTextFontSize = MetroTileTextSize.Tall; viewProgressBtn.TileTextFontWeight = MetroTileTextWeight.Bold; //----------------------------------------------------------// loginPic.ImageLocation = filename; accessChildDatabaseV2(filename); //Goes grayscale if (isCB == "Y") { colorTest(); r.Style = MetroFramework.MetroColorStyle.Silver; w.Style = MetroFramework.MetroColorStyle.Silver; e.Style = MetroFramework.MetroColorStyle.Silver; mathTile.Style = MetroColorStyle.Silver; spellTile.Style = MetroColorStyle.Silver; wordBankBtn.Style = MetroColorStyle.Silver; guessGameTile.Style = MetroColorStyle.Silver; viewProgressBtn.Style = MetroColorStyle.Silver; } else { r.Style = MetroFramework.MetroColorStyle.Orange; w.Style = MetroFramework.MetroColorStyle.Yellow; e.Style = MetroFramework.MetroColorStyle.Red; mathTile.Style = MetroColorStyle.Purple; spellTile.Style = MetroColorStyle.Lime; wordBankBtn.Style = MetroColorStyle.Teal; guessGameTile.Style = MetroColorStyle.Brown; viewProgressBtn.Style = MetroColorStyle.Green; } this.loginPic.SizeMode = PictureBoxSizeMode.Zoom; vAssist = new VoiceAssistant(); vAssist.SpeakMessage("Welcome, Please select an option !"); }
private void initStyle() { this.StyleManager = msmMain; for (int i = 3; i < 15; i++) { MetroTile _tile = new MetroTile(); _tile.Size = new Size(30, 30); _tile.Tag = i; _tile.Style = (MetroColorStyle)i; _tile.Click += _tile_Click; flpSettings.Controls.Add(_tile); } }
private void InitializeComponent() { ComponentResourceManager manager = new ComponentResourceManager(typeof(Form4)); this.metroTile1 = new MetroTile(); this.pictureBox8 = new PictureBox(); this.pictureBox1 = new PictureBox(); this.metroTile2 = new MetroTile(); this.pictureBox7 = new PictureBox(); this.pictureBox6 = new PictureBox(); this.pictureBox2 = new PictureBox(); this.metroTile3 = new MetroTile(); this.pictureBox3 = new PictureBox(); this.metroTile4 = new MetroTile(); this.pictureBox4 = new PictureBox(); this.metroTile5 = new MetroTile(); this.pictureBox5 = new PictureBox(); this.openFileDialog1 = new OpenFileDialog(); this.folderBrowserDialog1 = new FolderBrowserDialog(); this.textBox1 = new TextBox(); this.backgroundWorker1 = new BackgroundWorker(); this.metroProgressBar1 = new MetroProgressBar(); this.metroTile6 = new MetroTile(); this.pictureBox9 = new PictureBox(); this.metroTile7 = new MetroTile(); this.pictureBox10 = new PictureBox(); this.panel1 = new Panel(); this.metroLabel1 = new MetroLabel(); this.pictureBox11 = new PictureBox(); this.pictureBox12 = new PictureBox(); this.panel2 = new Panel(); this.metroLabel6 = new MetroLabel(); this.metroLabel5 = new MetroLabel(); this.pictureBox14 = new PictureBox(); this.metroLabel3 = new MetroLabel(); this.metroLabel4 = new MetroLabel(); this.metroLabel2 = new MetroLabel(); this.pictureBox13 = new PictureBox(); this.textBox2 = new TextBox(); this.metroLabel7 = new MetroLabel(); this.metroTile1.SuspendLayout(); ((ISupportInitialize) this.pictureBox8).BeginInit(); ((ISupportInitialize) this.pictureBox1).BeginInit(); this.metroTile2.SuspendLayout(); ((ISupportInitialize) this.pictureBox7).BeginInit(); ((ISupportInitialize) this.pictureBox6).BeginInit(); ((ISupportInitialize) this.pictureBox2).BeginInit(); this.metroTile3.SuspendLayout(); ((ISupportInitialize) this.pictureBox3).BeginInit(); this.metroTile4.SuspendLayout(); ((ISupportInitialize) this.pictureBox4).BeginInit(); this.metroTile5.SuspendLayout(); ((ISupportInitialize) this.pictureBox5).BeginInit(); this.metroTile6.SuspendLayout(); ((ISupportInitialize) this.pictureBox9).BeginInit(); this.metroTile7.SuspendLayout(); ((ISupportInitialize) this.pictureBox10).BeginInit(); ((ISupportInitialize) this.pictureBox11).BeginInit(); ((ISupportInitialize) this.pictureBox12).BeginInit(); this.panel2.SuspendLayout(); ((ISupportInitialize) this.pictureBox14).BeginInit(); ((ISupportInitialize) this.pictureBox13).BeginInit(); base.SuspendLayout(); this.metroTile1.ActiveControl = null; this.metroTile1.BackColor = Color.Transparent; this.metroTile1.Controls.Add(this.pictureBox8); this.metroTile1.Controls.Add(this.pictureBox1); this.metroTile1.ForeColor = Color.Lavender; this.metroTile1.Location = new Point(0x34, 0x60); this.metroTile1.Name = "metroTile1"; this.metroTile1.Size = new Size(0xdb, 0x86); this.metroTile1.Style = MetroColorStyle.Blue; this.metroTile1.TabIndex = 0; this.metroTile1.Text = "Launch"; this.metroTile1.Theme = MetroThemeStyle.Light; this.metroTile1.UseSelectable = true; this.metroTile1.Click += new EventHandler(this.metroTile1_Click); this.pictureBox8.Image = Resources.pre; this.pictureBox8.Location = new Point(0x2c, 0x11); this.pictureBox8.Name = "pictureBox8"; this.pictureBox8.Size = new Size(0x77, 0x5b); this.pictureBox8.SizeMode = PictureBoxSizeMode.StretchImage; this.pictureBox8.TabIndex = 1; this.pictureBox8.TabStop = false; this.pictureBox8.Click += new EventHandler(this.pictureBox8_Click); this.pictureBox1.Image = Resources._0074; this.pictureBox1.Location = new Point(0x2b, 0x11); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new Size(120, 0x5b); this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; this.pictureBox1.Click += new EventHandler(this.pictureBox1_Click); this.metroTile2.ActiveControl = null; this.metroTile2.BackColor = Color.Transparent; this.metroTile2.Controls.Add(this.pictureBox7); this.metroTile2.Controls.Add(this.pictureBox6); this.metroTile2.Controls.Add(this.pictureBox2); this.metroTile2.Location = new Point(0x14b, 0x60); this.metroTile2.Name = "metroTile2"; this.metroTile2.Size = new Size(0x9b, 0x86); this.metroTile2.Style = MetroColorStyle.Blue; this.metroTile2.TabIndex = 1; this.metroTile2.Text = "Load"; this.metroTile2.Theme = MetroThemeStyle.Light; this.metroTile2.UseSelectable = true; this.metroTile2.Click += new EventHandler(this.metroTile2_Click); this.pictureBox7.Image = Resources.error_7_xxl; this.pictureBox7.Location = new Point(0x26, 0x29); this.pictureBox7.Name = "pictureBox7"; this.pictureBox7.Size = new Size(0x45, 0x3b); this.pictureBox7.SizeMode = PictureBoxSizeMode.StretchImage; this.pictureBox7.TabIndex = 2; this.pictureBox7.TabStop = false; this.pictureBox7.Visible = false; this.pictureBox7.Click += new EventHandler(this.pictureBox7_Click); this.pictureBox6.Image = Resources.loaded; this.pictureBox6.Location = new Point(30, 0x15); this.pictureBox6.Name = "pictureBox6"; this.pictureBox6.Size = new Size(0x5f, 0x5d); this.pictureBox6.SizeMode = PictureBoxSizeMode.StretchImage; this.pictureBox6.TabIndex = 1; this.pictureBox6.TabStop = false; this.pictureBox6.Visible = false; this.pictureBox6.Click += new EventHandler(this.pictureBox6_Click_1); this.pictureBox2.Image = Resources.loader; this.pictureBox2.Location = new Point(0x25, 0x29); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new Size(0x40, 0x3b); this.pictureBox2.SizeMode = PictureBoxSizeMode.Zoom; this.pictureBox2.TabIndex = 0; this.pictureBox2.TabStop = false; this.pictureBox2.Click += new EventHandler(this.pictureBox2_Click); this.metroTile3.ActiveControl = null; this.metroTile3.BackColor = Color.Transparent; this.metroTile3.Controls.Add(this.pictureBox3); this.metroTile3.Location = new Point(0x2ac, 0x60); this.metroTile3.Name = "metroTile3"; this.metroTile3.Size = new Size(0x9b, 0x86); this.metroTile3.Style = MetroColorStyle.Blue; this.metroTile3.TabIndex = 2; this.metroTile3.Text = "About"; this.metroTile3.Theme = MetroThemeStyle.Light; this.metroTile3.UseSelectable = true; this.metroTile3.Click += new EventHandler(this.metroTile3_Click); this.pictureBox3.Image = Resources.question; this.pictureBox3.Location = new Point(0x2e, 40); this.pictureBox3.Name = "pictureBox3"; this.pictureBox3.Size = new Size(0x3f, 0x3b); this.pictureBox3.SizeMode = PictureBoxSizeMode.Zoom; this.pictureBox3.TabIndex = 0; this.pictureBox3.TabStop = false; this.pictureBox3.Click += new EventHandler(this.pictureBox3_Click); this.metroTile4.ActiveControl = null; this.metroTile4.BackColor = Color.Transparent; this.metroTile4.Controls.Add(this.pictureBox4); this.metroTile4.Location = new Point(0x1fb, 0x60); this.metroTile4.Name = "metroTile4"; this.metroTile4.Size = new Size(0x9b, 0x86); this.metroTile4.Style = MetroColorStyle.Blue; this.metroTile4.TabIndex = 3; this.metroTile4.Text = "Suggestions"; this.metroTile4.Theme = MetroThemeStyle.Light; this.metroTile4.UseSelectable = true; this.metroTile4.Click += new EventHandler(this.metroTile4_Click); this.pictureBox4.Image = Resources.sugsn; this.pictureBox4.Location = new Point(0x2d, 0x27); this.pictureBox4.Name = "pictureBox4"; this.pictureBox4.Size = new Size(0x3e, 0x3b); this.pictureBox4.SizeMode = PictureBoxSizeMode.Zoom; this.pictureBox4.TabIndex = 0; this.pictureBox4.TabStop = false; this.pictureBox4.Click += new EventHandler(this.pictureBox4_Click); this.metroTile5.ActiveControl = null; this.metroTile5.BackColor = Color.Transparent; this.metroTile5.Controls.Add(this.pictureBox5); this.metroTile5.Location = new Point(0x2ac, 0xef); this.metroTile5.Name = "metroTile5"; this.metroTile5.Size = new Size(0x9b, 0x86); this.metroTile5.Style = MetroColorStyle.Blue; this.metroTile5.TabIndex = 4; this.metroTile5.Text = "Exit"; this.metroTile5.Theme = MetroThemeStyle.Light; this.metroTile5.UseSelectable = true; this.metroTile5.Click += new EventHandler(this.metroTile5_Click); this.pictureBox5.Image = Resources.exit_256; this.pictureBox5.Location = new Point(0x2f, 40); this.pictureBox5.Name = "pictureBox5"; this.pictureBox5.Size = new Size(0x3f, 0x3b); this.pictureBox5.SizeMode = PictureBoxSizeMode.Zoom; this.pictureBox5.TabIndex = 0; this.pictureBox5.TabStop = false; this.pictureBox5.Click += new EventHandler(this.pictureBox5_Click); this.textBox1.Location = new Point(0x232, 12); this.textBox1.Name = "textBox1"; this.textBox1.Size = new Size(100, 20); this.textBox1.TabIndex = 5; this.textBox1.Visible = false; this.backgroundWorker1.WorkerReportsProgress = true; this.backgroundWorker1.DoWork += new DoWorkEventHandler(this.backgroundWorker1_DoWork); this.backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged); this.backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted); this.metroProgressBar1.FontWeight = MetroProgressBarWeight.Regular; this.metroProgressBar1.Location = new Point(0x34, 210); this.metroProgressBar1.Name = "metroProgressBar1"; this.metroProgressBar1.ProgressBarStyle = ProgressBarStyle.Blocks; this.metroProgressBar1.Size = new Size(0xdb, 4); this.metroProgressBar1.Style = MetroColorStyle.Blue; this.metroProgressBar1.TabIndex = 6; this.metroProgressBar1.TextAlign = ContentAlignment.MiddleCenter; this.metroProgressBar1.Theme = MetroThemeStyle.Light; this.metroProgressBar1.Click += new EventHandler(this.metroProgressBar1_Click); this.metroTile6.ActiveControl = null; this.metroTile6.BackColor = Color.Transparent; this.metroTile6.Controls.Add(this.pictureBox9); this.metroTile6.Location = new Point(0x1fb, 0xef); this.metroTile6.Name = "metroTile6"; this.metroTile6.Size = new Size(0x9b, 0x86); this.metroTile6.Style = MetroColorStyle.Blue; this.metroTile6.TabIndex = 7; this.metroTile6.Text = "Report Bug"; this.metroTile6.Theme = MetroThemeStyle.Light; this.metroTile6.UseSelectable = true; this.metroTile6.Click += new EventHandler(this.metroTile6_Click); this.pictureBox9.Image = Resources.gif_bestpage_sk_33; this.pictureBox9.Location = new Point(0x22, 0x1a); this.pictureBox9.Name = "pictureBox9"; this.pictureBox9.Size = new Size(0x5b, 0x51); this.pictureBox9.SizeMode = PictureBoxSizeMode.Zoom; this.pictureBox9.TabIndex = 0; this.pictureBox9.TabStop = false; this.pictureBox9.Click += new EventHandler(this.pictureBox9_Click); this.metroTile7.ActiveControl = null; this.metroTile7.BackColor = Color.Transparent; this.metroTile7.Controls.Add(this.pictureBox10); this.metroTile7.Location = new Point(0x14b, 0xef); this.metroTile7.Name = "metroTile7"; this.metroTile7.Size = new Size(0x9b, 0x86); this.metroTile7.Style = MetroColorStyle.Blue; this.metroTile7.TabIndex = 8; this.metroTile7.Text = "Like Us on Facebook!!"; this.metroTile7.Theme = MetroThemeStyle.Light; this.metroTile7.UseSelectable = true; this.metroTile7.Click += new EventHandler(this.metroTile7_Click); this.pictureBox10.Image = Resources.fbmta; this.pictureBox10.Location = new Point(3, 0); this.pictureBox10.Name = "pictureBox10"; this.pictureBox10.Size = new Size(0x95, 0x73); this.pictureBox10.SizeMode = PictureBoxSizeMode.StretchImage; this.pictureBox10.TabIndex = 0; this.pictureBox10.TabStop = false; this.pictureBox10.Click += new EventHandler(this.pictureBox10_Click); this.panel1.BackColor = Color.Transparent; this.panel1.Location = new Point(0x25, 80); this.panel1.Name = "panel1"; this.panel1.Size = new Size(0x32f, 0x13c); this.panel1.TabIndex = 9; this.metroLabel1.AutoSize = true; this.metroLabel1.BackColor = Color.Transparent; this.metroLabel1.FontWeight = MetroLabelWeight.Bold; this.metroLabel1.Location = new Point(0xa3, 0x7f); this.metroLabel1.Name = "metroLabel1"; this.metroLabel1.Size = new Size(0x1e6, 0x72); this.metroLabel1.Style = MetroColorStyle.Green; this.metroLabel1.TabIndex = 100; this.metroLabel1.Text = "\r\n1. Now compatible with the PC having resolution 1024x768 and above.\r\n\r\n2. Some Small bugs have been fixed.\r\n\r\n "; this.metroLabel1.UseCustomBackColor = true; this.metroLabel1.UseStyleColors = true; this.pictureBox11.BackColor = Color.Transparent; this.pictureBox11.Image = Resources.online_test_318_23480; this.pictureBox11.Location = new Point(0x2c, 0x27); this.pictureBox11.Name = "pictureBox11"; this.pictureBox11.Size = new Size(60, 0x34); this.pictureBox11.SizeMode = PictureBoxSizeMode.StretchImage; this.pictureBox11.TabIndex = 0x65; this.pictureBox11.TabStop = false; this.pictureBox11.Click += new EventHandler(this.pictureBox11_Click); this.pictureBox11.MouseEnter += new EventHandler(this.pictureBox11_MouseEnter); this.pictureBox12.BackColor = Color.Transparent; this.pictureBox12.Image = Resources.facebook; this.pictureBox12.Location = new Point(0x2ed, 0x127); this.pictureBox12.Name = "pictureBox12"; this.pictureBox12.Size = new Size(0x2a, 0x2a); this.pictureBox12.SizeMode = PictureBoxSizeMode.StretchImage; this.pictureBox12.TabIndex = 0x68; this.pictureBox12.TabStop = false; this.pictureBox12.Click += new EventHandler(this.pictureBox12_Click); this.pictureBox12.MouseEnter += new EventHandler(this.pictureBox12_MouseEnter); this.panel2.BackgroundImage = Resources.sssssssssss; this.panel2.BackgroundImageLayout = ImageLayout.Stretch; this.panel2.Controls.Add(this.metroLabel7); this.panel2.Controls.Add(this.metroLabel6); this.panel2.Controls.Add(this.metroLabel5); this.panel2.Controls.Add(this.pictureBox14); this.panel2.Controls.Add(this.metroLabel3); this.panel2.Controls.Add(this.metroLabel4); this.panel2.Controls.Add(this.pictureBox12); this.panel2.Controls.Add(this.metroLabel2); this.panel2.Controls.Add(this.pictureBox13); this.panel2.Controls.Add(this.pictureBox11); this.panel2.Controls.Add(this.metroLabel1); this.panel2.Location = new Point(0x34, 0x25); this.panel2.Name = "panel2"; this.panel2.Size = new Size(0x329, 0x178); this.panel2.TabIndex = 10; this.panel2.Visible = false; this.panel2.MouseDown += new MouseEventHandler(this.panel2_MouseDown); this.metroLabel6.AutoSize = true; this.metroLabel6.BackColor = Color.Transparent; this.metroLabel6.FontSize = MetroLabelSize.Small; this.metroLabel6.FontWeight = MetroLabelWeight.Bold; this.metroLabel6.Location = new Point(0x71, 0x52); this.metroLabel6.Name = "metroLabel6"; this.metroLabel6.Size = new Size(0x13e, 15); this.metroLabel6.Style = MetroColorStyle.White; this.metroLabel6.TabIndex = 0x6f; this.metroLabel6.Text = "Copyright \x00a9 2014. Mock Test Adda - All Rights Reserved"; this.metroLabel6.UseCustomBackColor = true; this.metroLabel6.UseStyleColors = true; this.metroLabel5.AutoSize = true; this.metroLabel5.BackColor = Color.Transparent; this.metroLabel5.FontWeight = MetroLabelWeight.Bold; this.metroLabel5.Location = new Point(0x71, 0x3f); this.metroLabel5.Name = "metroLabel5"; this.metroLabel5.Size = new Size(0x6d, 0x13); this.metroLabel5.Style = MetroColorStyle.Blue; this.metroLabel5.TabIndex = 110; this.metroLabel5.Text = "MTA Beta 1.0.1"; this.metroLabel5.UseCustomBackColor = true; this.metroLabel5.UseStyleColors = true; this.pictureBox14.BackColor = Color.Transparent; this.pictureBox14.Image = Resources._new; this.pictureBox14.Location = new Point(400, 340); this.pictureBox14.Name = "pictureBox14"; this.pictureBox14.Size = new Size(0x196, 0x21); this.pictureBox14.SizeMode = PictureBoxSizeMode.CenterImage; this.pictureBox14.TabIndex = 0x6d; this.pictureBox14.TabStop = false; this.metroLabel3.AutoSize = true; this.metroLabel3.BackColor = Color.Transparent; this.metroLabel3.FontWeight = MetroLabelWeight.Bold; this.metroLabel3.Location = new Point(0x298, 0x13e); this.metroLabel3.Name = "metroLabel3"; this.metroLabel3.Size = new Size(0x54, 0x13); this.metroLabel3.Style = MetroColorStyle.Blue; this.metroLabel3.TabIndex = 0x6b; this.metroLabel3.Text = "Facebook!!"; this.metroLabel3.UseCustomBackColor = true; this.metroLabel3.UseStyleColors = true; this.metroLabel4.AutoSize = true; this.metroLabel4.BackColor = Color.Transparent; this.metroLabel4.FontWeight = MetroLabelWeight.Bold; this.metroLabel4.Location = new Point(0x1ce, 0x13e); this.metroLabel4.Name = "metroLabel4"; this.metroLabel4.Size = new Size(0x20, 0x13); this.metroLabel4.Style = MetroColorStyle.Red; this.metroLabel4.TabIndex = 0x6c; this.metroLabel4.Text = "P.S."; this.metroLabel4.UseCustomBackColor = true; this.metroLabel4.UseStyleColors = true; this.metroLabel2.AutoSize = true; this.metroLabel2.BackColor = Color.Transparent; this.metroLabel2.FontWeight = MetroLabelWeight.Bold; this.metroLabel2.Location = new Point(0x1e9, 0x13e); this.metroLabel2.Name = "metroLabel2"; this.metroLabel2.Size = new Size(0xb2, 0x13); this.metroLabel2.Style = MetroColorStyle.Green; this.metroLabel2.TabIndex = 0x6a; this.metroLabel2.Text = "Don't forget to Like us on"; this.metroLabel2.UseCustomBackColor = true; this.metroLabel2.UseStyleColors = true; this.pictureBox13.BackColor = Color.Transparent; this.pictureBox13.Image = Resources.button_cancel; this.pictureBox13.Location = new Point(0x2f7, -5); this.pictureBox13.Name = "pictureBox13"; this.pictureBox13.Size = new Size(50, 40); this.pictureBox13.SizeMode = PictureBoxSizeMode.StretchImage; this.pictureBox13.TabIndex = 0x69; this.pictureBox13.TabStop = false; this.pictureBox13.Click += new EventHandler(this.pictureBox13_Click); this.pictureBox13.MouseEnter += new EventHandler(this.pictureBox13_MouseEnter); this.textBox2.Location = new Point(0x2ac, 12); this.textBox2.Name = "textBox2"; this.textBox2.Size = new Size(100, 20); this.textBox2.TabIndex = 0x71; this.textBox2.Visible = false; this.metroLabel7.AutoSize = true; this.metroLabel7.BackColor = Color.Transparent; this.metroLabel7.FontWeight = MetroLabelWeight.Bold; this.metroLabel7.Location = new Point(0x47, 0x91); this.metroLabel7.Name = "metroLabel7"; this.metroLabel7.Size = new Size(0x5c, 0x13); this.metroLabel7.Style = MetroColorStyle.Red; this.metroLabel7.TabIndex = 0x70; this.metroLabel7.Text = "Change Log:"; this.metroLabel7.UseCustomBackColor = true; this.metroLabel7.UseStyleColors = true; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; this.BackgroundImage = Resources.finalbkmta; this.BackgroundImageLayout = ImageLayout.Stretch; base.ClientSize = new Size(930, 0x1ca); base.Controls.Add(this.textBox2); base.Controls.Add(this.panel2); base.Controls.Add(this.metroTile7); base.Controls.Add(this.metroTile6); base.Controls.Add(this.metroProgressBar1); base.Controls.Add(this.textBox1); base.Controls.Add(this.metroTile5); base.Controls.Add(this.metroTile4); base.Controls.Add(this.metroTile3); base.Controls.Add(this.metroTile2); base.Controls.Add(this.metroTile1); base.Controls.Add(this.panel1); this.DoubleBuffered = true; base.FormBorderStyle = FormBorderStyle.None; base.Icon = (Icon) manager.GetObject("$this.Icon"); base.Name = "Form4"; base.StartPosition = FormStartPosition.CenterScreen; this.Text = "MTA Beta"; base.Load += new EventHandler(this.Form4_Load); base.MouseDown += new MouseEventHandler(this.Form4_MouseDown); this.metroTile1.ResumeLayout(false); ((ISupportInitialize) this.pictureBox8).EndInit(); ((ISupportInitialize) this.pictureBox1).EndInit(); this.metroTile2.ResumeLayout(false); ((ISupportInitialize) this.pictureBox7).EndInit(); ((ISupportInitialize) this.pictureBox6).EndInit(); ((ISupportInitialize) this.pictureBox2).EndInit(); this.metroTile3.ResumeLayout(false); ((ISupportInitialize) this.pictureBox3).EndInit(); this.metroTile4.ResumeLayout(false); ((ISupportInitialize) this.pictureBox4).EndInit(); this.metroTile5.ResumeLayout(false); ((ISupportInitialize) this.pictureBox5).EndInit(); this.metroTile6.ResumeLayout(false); ((ISupportInitialize) this.pictureBox9).EndInit(); this.metroTile7.ResumeLayout(false); ((ISupportInitialize) this.pictureBox10).EndInit(); ((ISupportInitialize) this.pictureBox11).EndInit(); ((ISupportInitialize) this.pictureBox12).EndInit(); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); ((ISupportInitialize) this.pictureBox14).EndInit(); ((ISupportInitialize) this.pictureBox13).EndInit(); base.ResumeLayout(false); base.PerformLayout(); }
private void CreateMainPanelTile(Point location, out MetroTile out_mt, out MetroProgressSpinner out_ps) { var mt = new MetroTile(); mt.Parent = mainPanel; mt.Location = location; mt.ContextMenuStrip = metroContextMenu1; mt.Style = (MetroColorStyle)random.Next(4, 14); mt.Theme = MetroThemeStyle.Light; mt.Size = new Size(128, 116); mt.Click += (s, e) => { fixButton(); foreach (var kv2 in installedCustomGames) { var cg = kv2.Value; if (mt == cg.tile) { Process.Start(cg.url); break; } } }; // Setup the spinner MetroProgressSpinner ps = new MetroProgressSpinner(); ps.Parent = mt; ps.Visible = false; ps.Size = new Size(38, 38); ps.Location = new Point(44, 38); ps.Style = mt.Style; ps.Value = 70; out_mt = mt; out_ps = ps; }
public MetroSidePanel() { MetroSkinManager.ApplyMetroStyle(this); m_moveAnim = new MoveAnimation(); Padding = new Padding(4); MetroPanel contentPanel = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(contentPanel); contentPanel.Dock = DockStyle.Fill; Controls.Add(contentPanel); m_content = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(m_content); m_content.Dock = DockStyle.Fill; m_content.Controls.Clear(); m_content.ControlAdded += new ControlEventHandler(m_content_ControlAdded); m_content.ControlRemoved += new ControlEventHandler(m_content_ControlRemoved); contentPanel.Controls.Add(m_content); m_contentScrollbarV = new MetroScrollBar(MetroScrollOrientation.Vertical); MetroSkinManager.ApplyMetroStyle(m_contentScrollbarV); m_contentScrollbarV.Dock = DockStyle.Right; m_contentScrollbarV.Scroll += new ScrollEventHandler(m_contentScrollbarV_Scroll); contentPanel.Controls.Add(m_contentScrollbarV); m_contentScrollbarH = new MetroScrollBar(MetroScrollOrientation.Horizontal); MetroSkinManager.ApplyMetroStyle(m_contentScrollbarH); m_contentScrollbarH.Dock = DockStyle.Bottom; m_contentScrollbarH.Scroll += new ScrollEventHandler(m_contentScrollbarH_Scroll); contentPanel.Controls.Add(m_contentScrollbarH); MetroPanel titlePanel = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(titlePanel); titlePanel.Height = 20; titlePanel.Dock = DockStyle.Top; Controls.Add(titlePanel); m_titleBar = new MetroTile(); MetroSkinManager.ApplyMetroStyle(m_titleBar); m_titleBar.Text = "SidePanelControler"; m_titleBar.Height = titlePanel.Height; m_titleBar.Click += new EventHandler(m_titleBar_Click); titlePanel.Controls.Add(m_titleBar); m_dockImage = Bitmap.FromFile("resources/icons/appbar.pin.png"); m_undockImage = Bitmap.FromFile("resources/icons/appbar.pin.remove.png"); m_dockTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_dockTile); m_dockTile.Size = new Size(titlePanel.Height, titlePanel.Height); m_dockTile.Image = m_dockImage; m_dockTile.ImageAlign = ContentAlignment.MiddleCenter; m_dockTile.IsImageScaled = true; m_dockTile.ImageScale = new PointF(0.5f, 0.5f); m_dockTile.Click += new EventHandler(m_dockTile_Click); titlePanel.Controls.Add(m_dockTile); Load += new EventHandler(SidePanelControl_Load); ParentChanged += new EventHandler(SidePanelControl_ParentChanged); Fit(); Apply(); UpdateScrollbars(); }
private void SeasonTileClicked(object sender, EventArgs e) { var clicked = (MetroTile)sender; panelEpisodes.Controls.Clear(); panelEpisodes.Refresh(); var episodeList = new SortedList<int, MetroTile>(); foreach (var ep in _dataSource.Seasons.First(s => s.SeasonNumber == int.Parse(clicked.Text)).Episodes) { var tooltip = new MetroToolTip(); var episodeTile = new MetroTile() { Text = ep.EpisodeNumber.ToString(), StyleManager = StyleManager, Size = new Size(30, 30), TextAlign = ContentAlignment.MiddleCenter }; if (!string.IsNullOrEmpty(ep.AirDate)) { tooltip.SetToolTip(episodeTile, "Airdate : " + ep.AirDate); } episodeList.Add(ep.EpisodeNumber, episodeTile); } foreach (var item in episodeList) { panelEpisodes.Controls.Add(item.Value); } }
public List<TabInfo> GetRibbonMenuTags() { //SmartThreadPool pool = new SmartThreadPool(); List<TabInfo> tags = new List<TabInfo>(); foreach (var downloader in Downloader.GetAllDownloaders()) { var attributes = downloader.GetType().GetCustomAttributes(typeof(DownloaderAttribute), true); if (attributes != null) { foreach (DownloaderAttribute att in attributes) { var tag = tags.Find(p => p.Name == att.MetroTab); if (tag == null) { tag = new TabInfo(); tags.Add(tag); } tag.Name = att.MetroTab; //global::System.Resources.ResourceManager resourceMan = new global::System.Resources.ResourceManager("ComicDownloader.Properties.Resources", typeof(ComicDownloader.Properties.Resources).Assembly); Thread.Sleep(new Random().Next(1,10)); var m = new Random(DateTime.Now.Millisecond); int next = m.Next(0, int.MaxValue); var title = new MetroFramework.Controls.MetroTile(); title.ActiveControl = null; title.Tag = downloader; title.Location = new System.Drawing.Point(20, 150); title.Cursor = System.Windows.Forms.Cursors.Hand; title.Size = new System.Drawing.Size(150, 120); title.CustomBackground = true; var index = next%colorArray.Length; title.BackColor = colorArray[index]; title.CustomForeColor = true; title.ForeColor = ColorTranslator.FromHtml("#ffffff"); title.TileTextFontSize = MetroTileTextSize.Medium; title.TileTextFontWeight = MetroTileTextWeight.Bold; //title.Style = (MetroFramework.MetroColorStyle)(next%13); title.TabIndex = 2; //if (title.Style == MetroColorStyle.White) title.Style = MetroColorStyle.Red; title.Text = downloader.Name; title.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; title.Theme = MetroFramework.MetroThemeStyle.Dark; title.Click += new System.EventHandler(delegate(object sender, System.EventArgs e) { var dl = ((MetroTile)sender).Tag as Downloader; if (mainApp == null) mainApp = new AppMainForm(); mainApp.Show(); mainApp.SetDownloader(dl); mainApp.WindowState = FormWindowState.Maximized; }); this.metroToolTip1.SetToolTip(title, downloader.Name); //pool.QueueWorkItem(delegate(object obj) { // TitleLogoUpdate data = (TitleLogoUpdate)obj; // if(!string.IsNullOrEmpty(data.Downloader.Logo) ){ // var img = data.Downloader.Logo.DownloadAsImage(); // img = img.Clip(data.Title.Width, data.Title.Height); // data.Title.TileImage = img; // data.Title.UseTileImage = true; // data.Title.TileImageAlign = ContentAlignment.MiddleCenter; // data.Title.TextAlign = ContentAlignment.BottomCenter; // } //}, //new TitleLogoUpdate() //{ // Title = title, // Downloader = downloader //}); //tag.Titles.Add(metroTile2); tag.Titles.Add(title); } } } // pool.Start(); return tags; }
public MainForm() { // bring up the UI InitializeComponent(); // Check for settings updates. if (Settings.Default.UpdateRequired) { Settings.Default.Upgrade(); Settings.Default.UpdateRequired = false; Settings.Default.Save(); // open up changelog if (Settings.Default.OpenChangelog && !DEBUG) { Process.Start("https://github.com/Myll/Dota-2-ModKit/releases"); } } // setup hooks FormClosing += MainForm_FormClosing; tabControl.Selected += TabControl_Selected; githubTextBox.KeyDown += GithubTextBox_KeyDown; tabControl.SelectedIndexChanged += TabControl_SelectedIndexChanged; // check for updates updater = new Updater(this); updater.checkForUpdates(); // allow public accessibility to these AddonTile = addonTile; ProgressSpinner1 = progressSpinner1; SpellLibBtn = spellLibraryBtn; MetroToolTip1 = metroToolTip1; GameTile = gameTile; ContentTile = contentTile; FindSoundNameBtn = findSoundNameBtn; // init mainform controls stuff Size size = new Size(steamTile.Width, steamTile.Height); steamTile.TileImage = (Image)new Bitmap(Resources.steam_icon, size); luaRadioBtn.Checked = true; tabControl.SelectedIndex = 0; notificationLabel.Text = ""; versionLabel.Text = "v" + version; retrieveDotaDir(); // at this point assume valid dota dir. Debug.WriteLine("Directory: " + dotaDir); // save the dota dir Settings.Default.DotaDir = dotaDir; gamePath = Path.Combine(dotaDir, "game", "dota_addons"); contentPath = Path.Combine(dotaDir, "content", "dota_addons"); // create these dirs if they don't exist. if (!Directory.Exists(gamePath)) { Directory.CreateDirectory(gamePath); } if (!Directory.Exists(contentPath)) { Directory.CreateDirectory(contentPath); } // get all the addons in the 'game' dir. addons = getAddons(); // does this computer have any dota addons? if (addons.Count == 0) { MetroMessageBox.Show(this, "No Dota 2 addons detected. There must be one addon for D2ModKit to function properly. Exiting.", "No Dota 2 addons detected.", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(0); } // some functions in the Tick try and use mainform's controls on another thread. so we need to allot a very small amount of time for // mainform to init its controls. this is mainly for the very first run of modkit. Timer initTimer = new Timer(); initTimer.Interval = 100; initTimer.Tick += InitTimer_Tick; initTimer.Start(); }
public ReadAudioForm3(ReadPhaseForm readPhase, String lvl) { InitializeComponent(); vAssist = new VoiceAssistant(); vAssist.SpeakMessage("Say the Jolly phonic !"); backButton = this.backBtn; submitButton = this.startBtn; this.readPhase = readPhase; jollyPicBox.ImageLocation = "Class" + LoginForm.classSec + "_kidImages/" + lvl + ".jpg"; this.jollyPicBox.SizeMode = PictureBoxSizeMode.Zoom; lvlStr = lvl; startBtn.Style = MetroColorStyle.Red; backBtn.Style = MetroColorStyle.Purple; }