Image GetImage(MetroPanel panel) { foreach (Control item in metroPanel1.Controls) { if (item is MetroRadioButton) { MetroRadioButton rd = (MetroRadioButton)item; if (rd.Checked) { return(Image.FromFile(Environment.CurrentDirectory + $@"\..\..\Images\{rd.Name.ToLower().Replace("rd", "")}.jpg")); } } } return(null); }
private void btn_MouseLeave(object sender, EventArgs e) { MetroPanel pnl = (MetroPanel)sender; pnl.CustomBackground = true; // keep background color active button if (pnl.Tag.ToString() == "1") { pnl.BackColor = Color.FromArgb(52, 73, 94); } else { pnl.BackColor = Color.FromArgb(44, 62, 80); } }
private void btn_Click(object sender, EventArgs e) { MetroPanel pnl = (MetroPanel)sender; HienThiNoiDung(pnl.AccessibleName.ToString()); // remove all btn color foreach (MetroPanel item in mPanelMenu.Controls.OfType <MetroPanel>()) { item.Tag = "0"; item.BackColor = Color.FromArgb(44, 62, 80); } // click active button pnl.Tag = "1"; pnl.CustomBackground = true; pnl.BackColor = Color.FromArgb(52, 73, 94); }
public MetroPanel addCard(Domain.Entities.Car car, int i, int x, int y) { MetroPanel newCard = new MetroPanel(); newCard.Size = card.Size; newCard.Name = "Card" + i; newCard.TabIndex = i + 1; newCard.Location = new Point(x, y); newCard.Controls.Add(addPictureBox(car.Id)); newCard.Controls.Add(addTitle(car)); newCard.Controls.Add(addSubscription(car)); newCard.Controls.Add(addCifrao(car)); newCard.Controls.Add(addButton(car.Id)); return(newCard); }
void UpdateAccountPanels() { noaccL.Visible = m_Accounts.Count == 0; m_ClearBuffer.Clear(); foreach (MetroPanel panel in contaccP.Controls.OfType <MetroPanel>()) { if (panel.Tag != null && ((string)panel.Tag) == "initial") { continue; } m_ClearBuffer.Add(panel); } while (m_ClearBuffer.Count > 0) { int maxIdx = m_ClearBuffer.Count - 1; contaccP.Controls.Remove(m_ClearBuffer[maxIdx]); m_ClearBuffer.RemoveAt(maxIdx); } for (int i = 0; i < m_Accounts.Count; i++) { Account acc = m_Accounts[i]; MetroPanel newPanel = CloneControl(accP); newPanel.Location = new Point(newPanel.Location.X, accP.Location.Y + i * accP.Size.Height); int localCopy = i; newPanel.Click += (o, e) => SelectAccPanel((MetroPanel)o, localCopy); contaccP.Controls.Add(newPanel); MetroLabel userLabel = CloneControl(useraccL); userLabel.Text = acc.Username; userLabel.Click += (o, e) => SelectAccPanel((MetroPanel)((MetroLabel)o).Parent, localCopy); newPanel.Controls.Add(userLabel); MetroLabel nickLabel = CloneControl(nickaccL); nickLabel.Text = acc.Nickname; nickLabel.Click += (o, e) => SelectAccPanel((MetroPanel)((MetroLabel)o).Parent, localCopy); newPanel.Controls.Add(nickLabel); } }
//mouseLeave private void metroLabel_MouseLeave(object sender, EventArgs e) { //Xác định control đựa chọn (tương tác sự kiện) MetroLabel mLbl = (MetroLabel)sender; //Truy xuất đến phần tử chứa nó MetroPanel pnlParent = (MetroPanel)mLbl.Parent; pnlParent.UseCustomBackColor = true; if (pnlParent.Tag.ToString() == "1") { pnlParent.BackColor = Color.FromArgb(126, 158, 166); //Màu được thay đổi } else { pnlParent.BackColor = Color.FromArgb(0, 64, 80); // Màu gốc } }
private void InitializeSpecific() { m_specificPanel = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(m_specificPanel); m_specificPanel.Size = new Size(); m_specificPanel.AutoSize = true; m_specificPanel.Left = DEFAULT_SECTION_SEPARATOR; m_specificPanel.Top = m_generalPanel.Bottom + DEFAULT_SECTION_SEPARATOR; Controls.Add(m_specificPanel); MetroLabel title = new MetroLabel(); MetroSkinManager.ApplyMetroStyle(title); title.Text = "Project-specific"; title.Size = new Size(); title.AutoSize = true; m_specificPanel.Controls.Add(title); m_specificSaveProjectTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_specificSaveProjectTile); m_specificSaveProjectTile.Text = "SAVE\nPROJECT"; m_specificSaveProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.save.png"); m_specificSaveProjectTile.Size = DEFAULT_TILE_SIZE; m_specificSaveProjectTile.Location = new Point(DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_specificSaveProjectTile.Click += new EventHandler(m_specificSaveProjectTile_Click); m_specificPanel.Controls.Add(m_specificSaveProjectTile); m_specificExportProjectTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_specificExportProjectTile); m_specificExportProjectTile.Text = "EXPORT\nPROJECT"; m_specificExportProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.page.upload.png"); m_specificExportProjectTile.Size = DEFAULT_TILE_SIZE; m_specificExportProjectTile.Location = new Point(m_specificSaveProjectTile.Right + DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_specificExportProjectTile.Click += new EventHandler(m_specificExportProjectTile_Click); m_specificPanel.Controls.Add(m_specificExportProjectTile); m_specificCloseProjectTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_specificCloseProjectTile); m_specificCloseProjectTile.Text = "CLOSE\nPROJECT"; m_specificCloseProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.close.png"); m_specificCloseProjectTile.Size = DEFAULT_TILE_SIZE; m_specificCloseProjectTile.Location = new Point(m_specificExportProjectTile.Right + DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_specificCloseProjectTile.Click += new EventHandler(m_specificCloseProjectTile_Click); m_specificPanel.Controls.Add(m_specificCloseProjectTile); }
private void InitializeGeneral() { m_generalPanel = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(m_generalPanel); m_generalPanel.Size = new Size(); m_generalPanel.AutoSize = true; m_generalPanel.Left = DEFAULT_SECTION_SEPARATOR; m_generalPanel.Top = DEFAULT_SECTION_SEPARATOR; Controls.Add(m_generalPanel); MetroLabel title = new MetroLabel(); MetroSkinManager.ApplyMetroStyle(title); title.Text = "General"; title.Size = new Size(); title.AutoSize = true; m_generalPanel.Controls.Add(title); m_generalNewProjectTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_generalNewProjectTile); m_generalNewProjectTile.Text = "NEW\nPROJECT"; m_generalNewProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.page.new.png"); m_generalNewProjectTile.Size = DEFAULT_TILE_SIZE; m_generalNewProjectTile.Location = new Point(DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_generalNewProjectTile.Click += new EventHandler(m_generalNewProjectTile_Click); m_generalPanel.Controls.Add(m_generalNewProjectTile); m_generalOpenProjectTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_generalOpenProjectTile); m_generalOpenProjectTile.Text = "OPEN\nPROJECT"; m_generalOpenProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.page.edit.png"); m_generalOpenProjectTile.Size = DEFAULT_TILE_SIZE; m_generalOpenProjectTile.Location = new Point(m_generalNewProjectTile.Right + DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_generalOpenProjectTile.Click += new EventHandler(m_generalOpenProjectTile_Click); m_generalPanel.Controls.Add(m_generalOpenProjectTile); m_generalImportProjectTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_generalImportProjectTile); m_generalImportProjectTile.Text = "IMPORT\nPROJECT"; m_generalImportProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.page.download.png"); m_generalImportProjectTile.Size = DEFAULT_TILE_SIZE; m_generalImportProjectTile.Location = new Point(m_generalOpenProjectTile.Right + DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_generalImportProjectTile.Click += new EventHandler(m_generalImportProjectTile_Click); m_generalPanel.Controls.Add(m_generalImportProjectTile); }
private void MakeLoadScreen() { LoadPanel = new MetroPanel(); LoadSpinner = new MetroProgressSpinner(); LoadLabel = new MetroLabel(); LoadLabel2 = new MetroLabel(); LoadPanel.HorizontalScrollbarBarColor = true; LoadPanel.HorizontalScrollbarHighlightOnWheel = false; LoadPanel.HorizontalScrollbarSize = 10; LoadPanel.Location = new System.Drawing.Point(5, 60); LoadPanel.Name = "metroPanel1"; LoadPanel.Size = new System.Drawing.Size(740, 440); LoadPanel.TabIndex = 10; LoadPanel.VerticalScrollbarBarColor = true; LoadPanel.VerticalScrollbarHighlightOnWheel = false; LoadPanel.VerticalScrollbarSize = 10; LoadSpinner.Location = new System.Drawing.Point(326, 123); LoadSpinner.Maximum = 100; LoadSpinner.Name = "metroProgressSpinner1"; LoadSpinner.Size = new System.Drawing.Size(48, 48); LoadSpinner.TabIndex = 2; LoadSpinner.UseSelectable = true; LoadLabel.AutoSize = true; LoadLabel.Location = new System.Drawing.Point(323, 174); LoadLabel.Name = "label1"; LoadLabel.Size = new System.Drawing.Size(55, 15); LoadLabel.TabIndex = 3; LoadLabel.Text = "Working!"; LoadLabel2.AutoSize = true; LoadLabel2.Location = new System.Drawing.Point(170, 189); LoadLabel2.Name = "metroLabel1"; LoadLabel2.Size = new System.Drawing.Size(367, 19); LoadLabel2.TabIndex = 4; LoadLabel2.Text = "Please do not exit this program or restart until this is finished!"; LoadPanel.Controls.Add(LoadSpinner); LoadPanel.Controls.Add(LoadLabel); LoadPanel.Controls.Add(LoadLabel2); Controls.Add(LoadPanel); LoadPanel.BringToFront(); }
private void mPanelMenuItem_MouseLeave(object sender, EventArgs e) { //Xác định panel được chọn MetroPanel mPanel = (MetroPanel)sender; //Xét thuộc tính cho phép thay đổi màu nền mPanel.UseCustomBackColor = true; //Đổi màu nền mPanel.BackColor = Color.FromArgb(0, 64, 80); if (mPanel.Tag.ToString() == "1") { mPanel.BackColor = Color.FromArgb(126, 158, 166); //Màu được thay đổi } else { mPanel.BackColor = Color.FromArgb(0, 64, 80); // Màu gốc } }
//active private void mPanel_Click(object sender, EventArgs e) { MetroPanel mPanel = (MetroPanel)sender; MetroPanel mPanelParent = (MetroPanel)mPanel.Parent; // Panel cha (chứa) //Xóa màu foreach (MetroPanel pnlChild in mPanelParent.Controls.OfType <MetroPanel>()) { pnlChild.Tag = 0; pnlChild.BackColor = Color.FromArgb(0, 64, 80); // Màu gốc } //thêm màu panel được chọn mPanel.UseCustomBackColor = true; mPanel.Tag = 1; mPanel.BackColor = Color.FromArgb(126, 158, 166); //Lấy name của userControl gọi phương thức hiển thị nội dung uc NoiDungUserControl(mPanel.AccessibleName); }
public void metroLabel_Click(object sender, EventArgs e) { MetroLabel ml = (MetroLabel)sender; MetroPanel mp = (MetroPanel)ml.Parent; MetroPanel mpParent = (MetroPanel)mp.Parent; foreach (MetroPanel pChild in mpParent.Controls.OfType <MetroPanel>()) { pChild.Tag = 0; //pChild.BackColor = Color.FromArgb(0, 64, 80); pChild.BackColor = Color.Teal; } mpParent.UseCustomBackColor = true; mp.Tag = 0; mp.BackColor = Color.FromArgb(120, 158, 166); NoiDungUserControl(mp.AccessibleName); }
public ProjectFilesControl() { MetroSkinManager.ApplyMetroStyle(this); m_content = new MetroPanel(); m_content.Dock = DockStyle.Fill; Controls.Add(m_content); m_backImage = Bitmap.FromFile("resources/icons/appbar.arrow.left.png"); m_dirImage = Bitmap.FromFile("resources/icons/appbar.folder.png"); m_fileImage = Bitmap.FromFile("resources/icons/appbar.page.png"); m_fileCodeImage = Bitmap.FromFile("resources/icons/appbar.page.code.png"); m_fileImageImage = Bitmap.FromFile("resources/icons/appbar.page.image.png"); m_fileMusicImage = Bitmap.FromFile("resources/icons/appbar.page.music.png"); m_fileTextImage = Bitmap.FromFile("resources/icons/appbar.page.text.png"); m_fileDomImage = Bitmap.FromFile("resources/icons/appbar.page.xml.png"); RebuildList(); }
/// <summary> Returns a collection of Controls that is inside the specified Panel. </summary> public static List <Control> GetAllElementsInPanel(MetroPanel targetPanel) { List <Control> tempList = new List <Control>(); foreach (Control c in targetPanel.Controls) { tempList.Add(c); } if (tempList.Count != 0) { tempList.Reverse(); return(tempList); } else { return(null); } }
public static MetroPanel GetPictureBox(FlowLayoutPanel flowLayoutPanel, Image image, int panelSizeW, int panelSizeH) { var MetroPanel = new MetroPanel(); var PictureBox = new PictureBox(); var MetroTile = new MetroTile(); // // MetroPanel // MetroPanel.Controls.Add(MetroTile); MetroPanel.Controls.Add(PictureBox); MetroPanel.Location = new System.Drawing.Point(0, 0); //MetroPanel.Name = "metroPanel1"; MetroPanel.Size = new System.Drawing.Size(panelSizeW, panelSizeH); MetroPanel.TabIndex = 1; // // MetroTile // MetroTile.ActiveControl = null; MetroTile.Location = new System.Drawing.Point(3, 3); //MetroTile.Name = "metroTile1"; MetroTile.Size = new System.Drawing.Size(294, 76); MetroTile.TabIndex = 2; MetroTile.Text = "metroTile1"; // // PictureBox // PictureBox.Location = new System.Drawing.Point(3, 85); //PictureBox.Name = "pictureBox1"; PictureBox.Size = new System.Drawing.Size(294, 212); PictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; PictureBox.Image = image; PictureBox.TabIndex = 2; PictureBox.TabStop = false; flowLayoutPanel.Controls.Add(MetroPanel); flowLayoutPanel.Controls.SetChildIndex(MetroPanel, 0); return(MetroPanel); }
public PanelAgregarCuestionario(Model.Cuestionario cuestionario, Panel oMetroPanel, UserControl.ucAgregarCuestionario FormWithList) { this.FormWithList = FormWithList; this.oCuestionario = cuestionario; this.lbTitulo = new MetroLabel(); this.lbTitulo.Text = "Título: "; this.lbTitulo.Location = new System.Drawing.Point(31, 24); this.lbCantPreguntas = new MetroLabel(); this.lbCantPreguntas.Text = "Cantidad de preguntas: "; this.lbCantPreguntas.Location = new System.Drawing.Point(31, 57); this.lbTotal = new MetroLabel(); this.lbTotal.Text = "Total: $"; this.lbTotal.Location = new System.Drawing.Point(31, 88); this.oPanel = new MetroPanel(); this.oPanel.Dock = System.Windows.Forms.DockStyle.Top; this.oPanel.Height = 130; this.oBar = new MetroPanel(); this.oBar.Dock = System.Windows.Forms.DockStyle.Bottom; this.oBar.Height = 5; this.oBar.UseCustomBackColor = true; this.oBar.BackColor = MetroColors.Blue; this.oPanel.Controls.Add(oBar); this.btnRemove = new MetroButton(); this.btnRemove.Text = "Remover"; this.btnRemove.Size = this.btnRemove.PreferredSize; this.btnRemove.Location = new System.Drawing.Point(421, 53); this.btnRemove.Click += (x, y) => { oMetroPanel.Controls.Remove(this.oPanel); FormWithList.ListaCuestionarios.Remove(oCuestionario); }; this.oPanel.Controls.Add(btnRemove); this.oPanel.Controls.Add(lbTitulo); this.oPanel.Controls.Add(lbCantPreguntas); this.oPanel.Controls.Add(lbTotal); }
/// <summary> /// Получение выбранного текста из панели /// </summary> /// <param name="Panel"></param> /// <returns></returns> private string GetCheckedValueFromPanel(MetroPanel Panel) { foreach (var ctrl in Panel.Controls) { try { if (ctrl.GetType().Name == "MetroRadioButton") { var m = ctrl as MetroRadioButton; if (m.Checked) { return(m.Text); } } } finally { } } return(""); }
/// <summary> /// Creates panel. /// </summary> /// <param name="addAbsoluteAlert">Include default controls?</param> /// <returns></returns> protected MetroPanel BaseGetOptions(bool addAbsoluteAlert = false) { var panel = new MetroPanel { Location = new System.Drawing.Point(278, 7), Name = "Panel", Size = new System.Drawing.Size(433, 146), }; if (addAbsoluteAlert) { object[] controls = AbsoluteAlert.GetOptions(); panel.Controls.Add(((MetroTextBox)controls[0])); panel.Controls.Add(((MetroComboBox)controls[1])); panel.Controls.Add(((MetroLabel)controls[2])); panel.Controls.Add(((MetroLabel)controls[3])); } return(panel); }
public PanelMisPreguntas() { this.lbPregunta = new MetroLabel(); this.lbPregunta.Text = "Pregunta: "; this.lbPregunta.Location = new System.Drawing.Point(30, 14); this.lbOpcion1 = new MetroLabel(); this.lbOpcion1.Text = "Opción 1: "; this.lbOpcion1.Location = new System.Drawing.Point(30, 62); this.lbOpcion2 = new MetroLabel(); this.lbOpcion2.Text = "Opción 2: "; this.lbOpcion2.Location = new System.Drawing.Point(30, 110); this.lbOpcion3 = new MetroLabel(); this.lbOpcion3.Text = "Opción 3: "; this.lbOpcion3.Location = new System.Drawing.Point(30, 149); this.lbOpcion4 = new MetroLabel(); this.lbOpcion4.Text = "Opción 4: "; this.lbOpcion4.Location = new System.Drawing.Point(30, 189); this.oPanel = new MetroPanel(); this.oPanel.Dock = System.Windows.Forms.DockStyle.Top; this.oPanel.Height = 214; this.oBar = new MetroPanel(); this.oBar.Dock = System.Windows.Forms.DockStyle.Bottom; this.oBar.Height = 5; this.oBar.UseCustomBackColor = true; this.oBar.BackColor = MetroColors.Blue; this.oPanel.Controls.Add(oBar); this.oPanel.Controls.Add(lbPregunta); this.oPanel.Controls.Add(lbOpcion1); this.oPanel.Controls.Add(lbOpcion2); this.oPanel.Controls.Add(lbOpcion3); this.oPanel.Controls.Add(lbOpcion4); }
private void metroLabel_Click(object sender, EventArgs e) { MetroPanel activePanel = null; MetroLabel lbl = sender as MetroLabel; if (lbl != previousActiveLabel) { previousActiveLabel.BackColor = Color.FromArgb(171, 206, 228); lbl.BackColor = Color.FromArgb(255, 255, 255); switch (lbl.Name) { case "metroLabel1": activePanel = metroPanelBase; break; case "metroLabel2": activePanel = metroPanelServer; break; case "metroLabel3": activePanel = metroPanelHotKey; break; case "metroLabel4": activePanel = metroPanelAccount; break; case "metroLabel5": activePanel = metroPanelOther; break; } if (activePanel != null) { activePanel.BringToFront(); } previousActiveLabel = lbl; } }
public LoLGame(MetroPanel gamePanel) : base(new LoLEngine(12), gamePanel) { List <Control> WoWControls = Finder.GetAllElementsInPanel(gamePanel); letterDisp = Finder.FindElementsWithTag(WoWControls, "CharacterDisplayButton"); foreach (Control b in letterDisp) { b.MouseClick += addToAnswer; b.Enabled = false; } usedLetters = new List <Control>(); currentWordDisplay = new Display(Finder.FindElementWithTag(WoWControls, "CurrentWord")); longestWordDisplay = new Display(Finder.FindElementWithTag(WoWControls, "LongestWord")); mainDisp = new LoLDisplay(letterDisp.ToArray(), letterDisp.Count); engine = mainEngine as LoLEngine; engine.Subscribe(mainDisp); GUIElements.Add(mainDisp); GUIElements.Add(currentWordDisplay); GUIElements.Add(longestWordDisplay); anims.Add(mainDisp); checkBox = Finder.FindElementWithTag(WoWControls, "CheckFeedback"); check = Finder.FindElementWithTag(WoWControls, "CheckerButton"); check.MouseClick += wordFeedback; submit = Finder.FindElementWithTag(WoWControls, "SSButton"); submit.MouseClick += ssClick; undo = Finder.FindElementWithTag(WoWControls, "UndoButton"); undo.MouseClick += undoLastLetter; answer = ""; engine.Broadcast(engine.GetLetters()); }
public int txtKontrol(string[] txtBoxAdlar, MetroPanel pnl, MetroForm frm, MetroTabControl tb) { int i = 0; while (i < txtBoxAdlar.Length) { MetroTextBox txtBox = (MetroTextBox)tb.Controls.Find("txt" + txtBoxAdlar[i], true)[0]; if (txtBox.Text == string.Empty) { MetroMessageBox.Show(frm, "Hata !", " Alanların hepsi doldurulmalı !", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } else if (txtBox.Text != string.Empty) { i++; } } if (txtBoxAdlar.Length == i) { return(1); } return(0); }
public int txtKontrol(string[] txtBoxAdlar, MetroPanel pnl, MetroForm frm) { int i = 0; while (i < txtBoxAdlar.Length) { MetroTextBox txtBox = (MetroTextBox)pnl.Controls.Find("txt" + txtBoxAdlar[i], true)[0]; if (txtBox.Text == string.Empty) { MetroMessageBox.Show(frm, "Hata !", txtBoxAdlar[i] + " alanı boş olamaz", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } else if (txtBox.Text != string.Empty) { i++; } } if (txtBoxAdlar.Length == i) { return(1); } return(0); }
//----------------------------------- public PanelMisCuestionarios(List <DataRow> ListPreguntas) { this.lbTitulo = new MetroLabel(); this.lbTitulo.Text = "Título: "; this.lbTitulo.Location = new System.Drawing.Point(31, 24); this.lbCantPreguntas = new MetroLabel(); this.lbCantPreguntas.Text = "Cantidad de preguntas: "; this.lbCantPreguntas.Location = new System.Drawing.Point(31, 57); this.lbTotal = new MetroLabel(); this.lbTotal.Text = "Total: $"; this.lbTotal.Location = new System.Drawing.Point(31, 88); this.oPanel = new MetroPanel(); this.oPanel.Dock = System.Windows.Forms.DockStyle.Top; this.oPanel.Height = 130; this.oBar = new MetroPanel(); this.oBar.Dock = System.Windows.Forms.DockStyle.Bottom; this.oBar.Height = 5; this.oBar.UseCustomBackColor = true; this.oBar.BackColor = MetroColors.Blue; this.oPanel.Controls.Add(oBar); this.btnVerDetalle = new MetroButton(); this.btnVerDetalle.Text = "Ver Detalles"; this.btnVerDetalle.Size = this.btnVerDetalle.PreferredSize; this.btnVerDetalle.Location = new System.Drawing.Point(421, 53); this.btnVerDetalle.Click += (x, y) => { new Forms.DetalleMisCuestionarios(ListPreguntas).ShowDialog(); }; this.oPanel.Controls.Add(btnVerDetalle); this.oPanel.Controls.Add(lbTitulo); this.oPanel.Controls.Add(lbCantPreguntas); this.oPanel.Controls.Add(lbTotal); }
private void metroButton7_Click(object sender, EventArgs e) { var allFullPanels = trackPanel.Controls.OfType <MetroPanel>().OrderBy(c => c.TabIndex); MetroPanel lastFullPanel = allFullPanels.Last(); MetroPanel newFullPanel = new MetroPanel(); newFullPanel.Location = new Point(lastFullPanel.Location.X + lastFullPanel.Size.Width + 40, lastFullPanel.Location.Y); newFullPanel.Size = lastFullPanel.Size; newFullPanel.TabIndex = lastFullPanel.TabIndex + 1; newFullPanel.Visible = true; for (int i = 0; i < 4; i++) { MetroPanel newQuarterPanel = new MetroPanel(); newQuarterPanel.Location = new Point(i * 50, 5); newQuarterPanel.TabIndex = i; newQuarterPanel.Size = new Size(40, 90); newQuarterPanel.Visible = true; for (int ii = 0; ii < 4; ii++) { MetroToggle newToggleButton = new MetroToggle(); newToggleButton.AutoSize = false; newToggleButton.Size = new Size(30, 17); newToggleButton.Location = new Point(5, (ii * 20) + 5); newToggleButton.TabIndex = ii; newToggleButton.Tag = ii; newToggleButton.Visible = true; newToggleButton.DisplayStatus = false; newQuarterPanel.Controls.Add(newToggleButton); } newFullPanel.Controls.Add(newQuarterPanel); } trackPanel.Controls.Add(newFullPanel); }
public PanelAgregarPregunta(Model.Pregunta oPregunta, Panel pnAgregarCuestionario, Forms.AgregarCuestionario agregarCuestionario) { this.oPregunta = oPregunta; this.FormWithList = agregarCuestionario; this.lbPregunta = new MetroLabel(); this.lbPregunta.Location = new System.Drawing.Point(12, 16); this.lbTipoPregunta = new MetroLabel(); this.lbTipoPregunta.Location = new System.Drawing.Point(12, 58); this.btnRemove = new MetroButton(); this.btnRemove.Text = "Remover"; this.btnRemove.Size = this.btnRemove.PreferredSize; this.btnRemove.Location = new System.Drawing.Point(318, 34); this.btnRemove.Click += (e, z) => { agregarCuestionario.ListPreguntas.Remove(oPregunta); pnAgregarCuestionario.Controls.Remove(oPanel); }; this.oPanel = new Panel(); this.oPanel.Dock = System.Windows.Forms.DockStyle.Top; this.oPanel.Height = 105; this.oBar = new MetroPanel(); this.oBar.Dock = System.Windows.Forms.DockStyle.Bottom; this.oBar.Height = 5; this.oBar.UseCustomBackColor = true; this.oBar.BackColor = MetroColors.Blue; this.oPanel.Controls.Add(oBar); this.oPanel.Controls.Add(lbPregunta); this.oPanel.Controls.Add(lbTipoPregunta); this.oPanel.Controls.Add(btnRemove); }
public userCMenu(List <aeMenu> menus, int idModulo, MetroFramework.Forms.MetroForm padre, MetroPanel pPnlPrincipal) { InitializeComponent(); Padre = padre; pnlPrincipal = pPnlPrincipal; IdModulo = idModulo; foreach (var item in menus) { dicMenus.Add(item, Agregar(item.Name, item.IdApplication, item.Objeto)); } }
public override void BuildMetroPanel() { metroPanel = new MetroFramework.Controls.MetroPanel(); metroGrid = new MetroFramework.Controls.MetroGrid(); metroPanel.Dock = System.Windows.Forms.DockStyle.Fill; metroPanel.HorizontalScrollbarBarColor = true; metroPanel.HorizontalScrollbarHighlightOnWheel = false; metroPanel.HorizontalScrollbarSize = 10; metroPanel.Location = new System.Drawing.Point(0, 0); metroPanel.Name = "metroPanel"; metroPanel.Size = new System.Drawing.Size(1037, 443); metroPanel.TabIndex = 1; metroPanel.VerticalScrollbarBarColor = true; metroPanel.VerticalScrollbarHighlightOnWheel = false; metroPanel.VerticalScrollbarSize = 10; metroPanel.BackColor = Color.Blue; metroPanel.Controls.Add(metroGrid); metroPanel.ResumeLayout(true); ((System.ComponentModel.ISupportInitialize)(metroGrid)).BeginInit(); metroGrid.AllowUserToAddRows = false; metroGrid.AllowUserToDeleteRows = false; metroGrid.AllowUserToResizeRows = false; metroGrid.RowHeadersVisible = false; metroGrid.Dock = DockStyle.Fill; metroGrid.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); metroGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; metroGrid.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; metroGrid.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(219))))); dataGridViewCellStyle1.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(198)))), ((int)(((byte)(247))))); dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; metroGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; metroGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); dataGridViewCellStyle2.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(198)))), ((int)(((byte)(247))))); dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; metroGrid.DefaultCellStyle = dataGridViewCellStyle2; metroGrid.EnableHeadersVisualStyles = false; metroGrid.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); metroGrid.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); metroGrid.Location = new System.Drawing.Point(-29, 65); metroGrid.Name = "metroGrid"; metroGrid.ReadOnly = false; metroGrid.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(219))))); dataGridViewCellStyle3.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); dataGridViewCellStyle3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(198)))), ((int)(((byte)(247))))); dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; metroGrid.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; metroGrid.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; metroGrid.RowTemplate.Height = 24; metroGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; metroGrid.Size = new System.Drawing.Size(275, 163); metroGrid.TabIndex = 0; metroGrid.Theme = MetroFramework.MetroThemeStyle.Light; ((System.ComponentModel.ISupportInitialize)(metroGrid)).EndInit(); metroPanel.ResumeLayout(false); }
public EditorDialog( CollectionPropertyEditorUtils.CollectionType collectionType, Func <Dictionary <string, string>, string, PropertyEditor <T> > creator ) { m_collectionType = collectionType; m_creator = creator; MetroSkinManager.ApplyMetroStyle(this); Text = "Collection Editor"; TextAlign = MetroFormTextAlign.Center; Size = DEFAULT_SIZE; ShowInTaskbar = false; ControlBox = false; Resizable = false; DialogResult = DialogResult.None; MetroPanel panel = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(panel); panel.Dock = DockStyle.Fill; Controls.Add(panel); MetroPanel contentPanel = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(contentPanel); contentPanel.Width = panel.Width; contentPanel.Height = panel.Height - DEFAULT_BUTTON_HEIGHT - DEFAULT_SEPARATOR - DEFAULT_BUTTON_HEIGHT - 16; contentPanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; panel.Controls.Add(contentPanel); m_content = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(m_content); m_content.Dock = DockStyle.Fill; m_content.Controls.Clear(); 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_addButton = new MetroTile(); MetroSkinManager.ApplyMetroStyle(m_addButton); m_addButton.Text = "Add Item"; m_addButton.TextAlign = ContentAlignment.MiddleCenter; m_addButton.TileTextFontWeight = MetroTileTextWeight.Bold; m_addButton.Width = panel.Width; m_addButton.Height = DEFAULT_BUTTON_HEIGHT; m_addButton.Top = panel.Height - DEFAULT_BUTTON_HEIGHT - DEFAULT_SEPARATOR - DEFAULT_BUTTON_HEIGHT; m_addButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; m_addButton.Click += new EventHandler(m_addButton_Click); panel.Controls.Add(m_addButton); m_okButton = new MetroTile(); MetroSkinManager.ApplyMetroStyle(m_okButton); m_okButton.Text = "OK"; m_okButton.TextAlign = ContentAlignment.MiddleCenter; m_okButton.TileTextFontWeight = MetroTileTextWeight.Bold; m_okButton.Width = panel.Width; m_okButton.Height = DEFAULT_BUTTON_HEIGHT; m_okButton.Top = panel.Height - DEFAULT_BUTTON_HEIGHT; m_okButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; m_okButton.Click += new EventHandler(m_okButton_Click); panel.Controls.Add(m_okButton); }
void main__form() { MetroPanel panel__left = new MetroPanel(); MetroTile panel__left__title = new MetroTile(); MetroPanel panel__Right = new MetroPanel(); MetroTile panel__Right__title = new MetroTile(); PictureBox[] picture__news = new PictureBox[8]; MetroLabel[] body = new MetroLabel[8]; MetroLabel[] date = new MetroLabel[8]; for (int i = 0; i < 8; i++) { date[i] = new MetroLabel(); picture__news[i] = new PictureBox(); body[i] = new MetroLabel(); } // Main // Left panel__left.Location = new Point(27, 72); panel__left.Size = new Size(1030, 720); panel__left.Name = "Left"; panel__left.Theme = MetroFramework.MetroThemeStyle.Dark; panel__left.BorderStyle = MetroFramework.Drawing.MetroBorderStyle.FixedSingle; //Left label panel__left__title.Location = new Point(3, 3); panel__left__title.Size = new Size(148, 53); panel__left__title.Name = "Left__title"; panel__left__title.Text = "Главное"; panel__left__title.Style = MetroFramework.MetroColorStyle.Red; //Right panel__Right.Location = new Point(1082, 72); panel__Right.Size = new Size(472, 720); panel__Right.Name = "Right"; panel__Right.Theme = MetroFramework.MetroThemeStyle.Dark; panel__Right.BorderStyle = MetroFramework.Drawing.MetroBorderStyle.FixedSingle; //Right__title panel__Right__title.Location = new Point(3, 3); panel__Right__title.Size = new Size(151, 53); panel__Right__title.Name = "Right__title"; panel__Right__title.Text = "Новости"; panel__Right__title.Style = MetroFramework.MetroColorStyle.Red; //Left Panel this.metroPanel2.Controls.Add(panel__left); panel__left.Controls.Add(panel__left__title); //Right Panel metroPanel2.Controls.Add(panel__Right); panel__Right.Controls.Add(panel__Right__title); connect con = new connect(); string[] news = con.news().Split('='); int width = 100; int j = 0; for (int i = news.Length - 2; i >= 0; i--) { if (j > -8) { //header date[Math.Abs(j)].Location = new Point(26, width); date[Math.Abs(j)].Size = new Size(76, 64); date[Math.Abs(j)].Name = "Body__News " + i; date[Math.Abs(j)].Text = news[i].Split('%')[0]; date[Math.Abs(j)].Theme = MetroFramework.MetroThemeStyle.Light; //body body[Math.Abs(j)].Location = new Point(106, width); body[Math.Abs(j)].Size = new Size(247, 64); body[Math.Abs(j)].Name = "Body__News " + i; body[Math.Abs(j)].Text = news[i].Split('%')[1]; body[Math.Abs(j)].Theme = MetroFramework.MetroThemeStyle.Light; //picturebox picture__news[Math.Abs(j)].Location = new Point(359, width); picture__news[Math.Abs(j)].Size = new Size(100, 64); picture__news[Math.Abs(j)].Name = "Body__News " + i; picture__news[Math.Abs(j)].Image = Image.FromFile(news[i].Split('%')[2]); picture__news[Math.Abs(j)].SizeMode = PictureBoxSizeMode.Zoom; panel__Right.Controls.Add(date[Math.Abs(j)]); panel__Right.Controls.Add(body[Math.Abs(j)]); panel__Right.Controls.Add(picture__news[Math.Abs(j)]); width += 78; j--; } else { break; } } }