Dispose() защищенный Метод

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
Результат void
        private void part_txt_Click(object sender, EventArgs e)
        {
            SearchPart Sp = new SearchPart();

            Sp.ShowDialog();

            pnum_txt.Text = Sp._PartNumber;

            desc_txt.Text = Sp._Description;

            pnum_txt_Leave(pnum_txt,e);

            Sp.Dispose();
        }
Пример #2
0
        private void Searchbtn_Click(object sender, EventArgs e)
        {
            SearchPart Searchfrm = new SearchPart(Searchtxt.Text);

            Searchfrm.ShowDialog();

            if (Searchfrm.DialogResult == DialogResult.OK)
                Searchtxt.Text = Searchfrm._PartNumber;

            Searchfrm.Close();

            Searchfrm.Dispose();
        }