示例#1
0
        private void newWindowUnique(object sender, EventArgs e) {
            if(internalWindowUnique == null) {
                internalWindowUnique = new frmSub(); //creates an instance of the window named 'window'.

                internalWindowUnique.MdiParent = this; //sets 'this' instance of frmMenu as its parent, so the window can host the instance.
                internalWindowUnique.Show(); //this is an equivalent from '.setVisible(true);' in Java. it just makes the window visible.

                internalWindowUnique.Text =  //sets the name of this window... {
                    txtWindowName.Text                 //gathers the name the user typed
                        .Replace(                     //and applies formatting syntax to it
                            "%N%",                   //where it replaces any entries of '%N%'
                            ++this.windowCount + "" //with the number of windows that the user had opened.
                        );//...}
            }
        }
示例#2
0
        private void newWindowMultiple(object sender, EventArgs e) {
            internalWindowMultiple = new frmSub(); //creates an instance of the window named 'window'.

            internalWindowMultiple.MdiParent = this; //sets 'this' instance of frmMenu as its parent, so the window can host the instance.
            internalWindowMultiple.Show(); //this is an equivalent from '.setVisible(true);' in Java. it just makes the window visible.
        }