Beispiel #1
0
        public void btnForm_Click(object sender, EventArgs e)    //Enter detail_form
        {
            Detail_form detail_form = new Detail_form(( int )(( Button )sender).Tag);

            detail_form.eNew_Instance_Created    += new EventHandler(eDetail_New_Instance_Created);
            detail_form.eDelete_Click            += new EventHandler <MyEventArgs>(eDetail_BtnDelete_Click);
            detail_form.eComplete_Creating_Child += new EventHandler <MyEventArgs>(eDetail_Complete_Creating_Child);
            detail_form.Show();
        }//End btnForm_Click()
        private void childrenList_ItemActivate(object sender, EventArgs e)
        {
            Detail_form child_form = new Detail_form((int)childrenList.FocusedItem.Tag);

            if (eNew_Instance_Created != null)
            {
                eNew_Instance_Created.Invoke(child_form, e); //Fire event to main to register handlers for new child_form
            }
            child_form.Show();
        }
        //Open parent form (keep current form)
        private void txtParent_DoubleClick(object sender, EventArgs e)
        {
            //Load DB detail_form with parent id (open parent in another form)
            Detail_form parent_form = new Detail_form((int)txtParent.Tag);

            if (eNew_Instance_Created != null)
            {
                eNew_Instance_Created.Invoke(parent_form, e); //Fire event to main to register handlers for new parent_form
            }
            parent_form.Show();
        }
Beispiel #4
0
        private void treeView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            //treeView.SelectedNode.Tag = 5; TODO: remove this code
            Detail_form df = new Detail_form(( int )treeView.SelectedNode.Tag);

            if (eNew_Instance_Created != null)
            {
                eNew_Instance_Created.Invoke(df, e);
            }

            df.Show();
        }