private void button1_Click(object sender, EventArgs e) { //Add a Panel control. Panel panel = new Panel(); this.Controls.Add(panel); //Create a Bitmap of size same as that of the Form. Graphics grp = panel.CreateGraphics(); Size formSize = this.ClientSize; bitmap = new Bitmap(formSize.Width, formSize.Height, grp); grp = Graphics.FromImage(bitmap); //Copy screen area that that the Panel covers. Point panelLocation = PointToScreen(panel.Location); grp.CopyFromScreen(panelLocation.X, panelLocation.Y, 0, 0, formSize); //Show the Print Preview Dialog. printPreviewDialog1.Document = printDocument1; printPreviewDialog1.PrintPreviewControl.Zoom = 1; printPreviewDialog1.ShowDialog(); home back = new home(); this.Hide(); back.Show(); }
private void button7_Click(object sender, EventArgs e) { home backobj = new home(); backobj.Show(); this.Close(); }
private void timer1_Tick(object sender, EventArgs e) { home obj1 = new home(); obj1.Show(); this.Hide(); time.Stop(); }