コード例 #1
0
        /// ------------------------------------------------------------------------------------
        private RadioButton AddStatusRadioButton(int row, int tabIndex, Session.Status status)
        {
            var statusRadioButton = new RadioButton
            {
                Name                    = "radioButton_" + status,
                Anchor                  = AnchorStyles.Top | AnchorStyles.Left,
                AutoEllipsis            = true,
                AutoSize                = true,
                Margin                  = new Padding(10, 4, 0, 2),
                Text                    = Session.GetLocalizedStatus(status.ToString()),
                Font                    = Program.DialogFont,
                UseVisualStyleBackColor = true,
                Tag      = status,
                TabIndex = tabIndex,
            };

            var toolTip = GetStatusToolTip(status);

            if (toolTip != null)
            {
                _toolTip.SetToolTip(statusRadioButton, toolTip);
            }

            statusRadioButton.MouseEnter += delegate
            {
                _toolTip.ToolTipTitle = statusRadioButton.Text;
            };

            statusRadioButton.CheckedChanged += HandleStatusRadioButtonCheckedChanged;

            _tableLayoutOuter.Controls.Add(statusRadioButton, 1, row);
            _statusRadioButtons.Add(statusRadioButton);
            return(statusRadioButton);
        }
コード例 #2
0
        /// ------------------------------------------------------------------------------------
        private PictureBox AddStatusImage(int row, Session.Status status)
        {
            var statusPicBox = new PictureBox
            {
                Name     = "picture_" + status,
                Anchor   = AnchorStyles.Top | AnchorStyles.Left,
                Image    = ResourceImageCache.GetBitmap("Status" + status),
                Margin   = new Padding(5, 4, 0, 2),
                SizeMode = PictureBoxSizeMode.AutoSize,
            };

            statusPicBox.Size = statusPicBox.Image.Size;

            var toolTip = GetStatusToolTip(status);

            if (toolTip != null)
            {
                _toolTip.SetToolTip(statusPicBox, toolTip);
            }

            statusPicBox.MouseEnter += delegate
            {
                _toolTip.ToolTipTitle = Session.GetLocalizedStatus(status.ToString());
            };

            if (row == _tableLayoutOuter.GetRow(_labelStages))
            {
                _tableLayoutOuter.RowStyles.Insert(row, new RowStyle(SizeType.AutoSize));
            }

            _tableLayoutOuter.Controls.Add(statusPicBox, 0, row);
            return(statusPicBox);
        }