/// <summary> /// btn_Resize_Click() /// This method gets called whenever the user clicks the resize button /// The canvas will need to be resized /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_Resize_Click(object sender, EventArgs e) { //is the ResizeWindow initialized already? if (rw == null) { //then the resize window needs initialized rw = new ResizeWindow(picb_Canvas.Size); //setup a new window rw.FormClosing += Rw_FormClosing; rw.Show(); } else { //then just focus the resize window rw.Show(); } }
/// <summary> /// Rw_FormClosing() /// This event handler will set the canvas size based on the public variable in the class' rw variable /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Rw_FormClosing(object sender, FormClosingEventArgs e) { picb_Canvas.Size = rw.sz_Resized; //get the resize size before closing the window HandlePnlResizing(); rw = null; }