סרטונים
הקוד של החלון mainWin
using System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows.Forms;
namespace exampleProj
{
public partial class mainWin : Form
{
Form current;
public mainWin()
{
InitializeComponent();
}
private void
mainWin_Load(object sender,
EventArgs e)
{
current = null;
}
private void
loadAddProductWin(object sender,
EventArgs e)
{
if(current != null)
{
if (current is
Forms.AddProductWin)
return;
current.Close();
}
current = new Forms.AddProductWin() { Dock =
DockStyle.Fill, TopLevel = false, TopMost = true,
FormBorderStyle = FormBorderStyle.None };
mainPanel.Controls.Add(current);
current.Show();
}
private void
loadUpdateProductWin(object sender,
EventArgs e)
{
if (current != null)
{
if (current is
Forms.ModifyProductWin)
return;
current.Close();
}
current = new Forms.ModifyProductWin() { Dock =
DockStyle.Fill, TopLevel = false, TopMost = true,
FormBorderStyle = FormBorderStyle.None };
mainPanel.Controls.Add(current);
current.Show();
}
private void
loadDeletePorductWin(object sender,
EventArgs e)
{
if (current != null)
{
if (current is
Forms.DeleteProductWin)
return;
current.Close();
}
current = new Forms.DeleteProductWin() { Dock =
DockStyle.Fill, TopLevel = false, TopMost = true,
FormBorderStyle = FormBorderStyle.None };
mainPanel.Controls.Add(current);
current.Show();
}
private void
loadAddCatWin(object sender,
EventArgs e)
{
if (current != null)
{
if (current is
Forms.AddCategoryWin)
return;
current.Close();
}
current = new Forms.AddCategoryWin() { Dock =
DockStyle.Fill, TopLevel = false, TopMost = true ,
FormBorderStyle = FormBorderStyle.None };
mainPanel.Controls.Add(current);
current.Show();
}
private void
loadModifyCatWin(object sender,
EventArgs e)
{
if (current != null)
{
if (current is
Forms.ModifyCategoryWin)
return;
current.Close();
}
current = new Forms.ModifyCategoryWin() { Dock =
DockStyle.Fill, TopLevel = false, TopMost = true
,FormBorderStyle = FormBorderStyle.None};
mainPanel.Controls.Add(current);
current.Show();
}
private void
loadDeleteCatWin(object sender,
EventArgs e)
{
if (current != null)
{
if (current is
Forms.DeleteCategoryWin)
return;
current.Close();
}
current = new Forms.DeleteCategoryWin() { Dock =
DockStyle.Fill, TopLevel = false, TopMost = true,
FormBorderStyle = FormBorderStyle.None };
mainPanel.Controls.Add(current);
current.Show();
}
}
}