public void ChangeFontsOfAllDataGridViews() { for (int i = 0; i < tabForms.Controls.Count; i++) { if (tabForms.Controls[i].Text == "Ekstre") { EkstreForm ekstreForm = (EkstreForm)tabForms.Controls[i].Tag; ekstreForm.DataGridView1.DefaultCellStyle.Font = ekstreForm.DataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font((string)Global.Instance.settings.FontFamily, (float)Global.Instance.settings.TextSize); ekstreForm.DataGridView2.DefaultCellStyle.Font = ekstreForm.DataGridView2.ColumnHeadersDefaultCellStyle.Font = new Font((string)Global.Instance.settings.FontFamily, (float)Global.Instance.settings.TextSize); } else if (tabForms.Controls[i].Text == "Malzeme Birim Fiyatı") { ItemPriceForm itemPriceForm = (ItemPriceForm)tabForms.Controls[i].Tag; itemPriceForm.DataGridView1.DefaultCellStyle.Font = itemPriceForm.DataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font((string)Global.Instance.settings.FontFamily, (float)Global.Instance.settings.TextSize); } else if (tabForms.Controls[i].Text == "Malzeme Hareketleri") { ItemsForm itemsForm = (ItemsForm)tabForms.Controls[i].Tag; itemsForm.DataGridView1.DefaultCellStyle.Font = itemsForm.DataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font((string)Global.Instance.settings.FontFamily, (float)Global.Instance.settings.TextSize); itemsForm.DataGridView2.DefaultCellStyle.Font = itemsForm.DataGridView2.ColumnHeadersDefaultCellStyle.Font = new Font((string)Global.Instance.settings.FontFamily, (float)Global.Instance.settings.TextSize); } else if (tabForms.Controls[i].Text == "Satış Faturaları") { InvoiceForm invoiceForm = (InvoiceForm)tabForms.Controls[i].Tag; invoiceForm.DataGridView1.DefaultCellStyle.Font = invoiceForm.DataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font((string)Global.Instance.settings.FontFamily, (float)Global.Instance.settings.TextSize); invoiceForm.DataGridView2.DefaultCellStyle.Font = invoiceForm.DataGridView2.ColumnHeadersDefaultCellStyle.Font = new Font((string)Global.Instance.settings.FontFamily, (float)Global.Instance.settings.TextSize); } } }
private void OpenItemsForm() { ItemsForm itemsForm = new ItemsForm(); itemsForm.MdiParent = this; itemsForm.Dock = DockStyle.Fill; itemsForm.TopLevel = false; itemsForm.FormBorderStyle = FormBorderStyle.None; itemsForm.Show(); TabPage tp = new TabPage(this.ActiveMdiChild.Text) { Tag = this.ActiveMdiChild, Parent = tabForms }; tabForms.SelectedTab = tp; this.ActiveMdiChild.Tag = tp; this.ActiveMdiChild.FormClosed += new FormClosedEventHandler(ActiveMdiChild_FormClosed); tp.Controls.Add(itemsForm); if (!tabForms.Visible) { tabForms.Visible = true; } }