예제 #1
0
        /// <summary>
        /// .NET Core 3 does not yet include a Forms Builder.
        /// So instead of adding the controls on a Forms Builder, we add them using code.
        /// </summary>
        void AddControls()
        {
            // x-coordinate of the leftmost controls.
            int leftStart = 20;

            Label lblDirectoryToSearch = new Label
            {
                Text     = "Directory to search:",
                Location = new Point(leftStart, 20),
                Size     = new Size(400, 20)
            };

            this.Controls.Add(lblDirectoryToSearch);

            tbDirectoryToSearch = new TextBox
            {
                Location = new Point(leftStart, 40),
                Size     = new Size(600, 20)
            };
            this.Controls.Add(tbDirectoryToSearch);

            Button btStartSearching = new Button()
            {
                Location = new Point(630, 40),
                Size     = new Size(100, 20),
                Text     = "Start searching",
            };

            btStartSearching.Click += BtStartSearching_Click;
            this.Controls.Add(btStartSearching);


            lblStatusMessage = new Label
            {
                Location  = new Point(leftStart, 70),
                Size      = new Size(700, 20),
                ForeColor = Color.Black,
                Text      = "Status: waiting for input."
            };
            this.Controls.Add(lblStatusMessage);

            int leftSideOfTagBox = 40;
            int topOfTagBox      = 100;

            tagInput1 = new DicomTagInputControl(this, leftSideOfTagBox, topOfTagBox);
            tagInput2 = new DicomTagInputControl(this, leftSideOfTagBox, topOfTagBox + 125);
            tagInput3 = new DicomTagInputControl(this, leftSideOfTagBox, topOfTagBox + 250);

            tbSearchResults = new TextBox()
            {
                Location   = new Point(280, 100),
                Size       = new Size(400, 400),
                Multiline  = true,
                Enabled    = false,
                ScrollBars = ScrollBars.Both
            };
            this.Controls.Add(tbSearchResults);
        }