Beispiel #1
0
        private void InitializeComponent()
        {
            var resources = new System.Resources.ResourceManager(typeof(frmMultiColumnListBox));

            components           = new System.ComponentModel.Container();
            ToolTip1             = new ToolTip(components);
            _lstItems            = new ListBox();
            _lstItems.MouseDown += new MouseEventHandler(lstItems_MouseDown);
            _lstItems.MouseMove += new MouseEventHandler(lstItems_MouseMove);
            labCaption           = new Label();
            SuspendLayout();
            ToolTip1.Active            = true;
            StartPosition              = FormStartPosition.Manual;
            BackColor                  = Color.FromArgb(192, 192, 192);
            FormBorderStyle            = FormBorderStyle.FixedSingle;
            Text                       = "MultiColumListBox";
            ClientSize                 = new Size(670, 446);
            Location                   = new Point(72, 116);
            Icon                       = (Icon)resources.GetObject("frmMultiColumnListBox.Icon");
            MaximizeBox                = false;
            AutoScaleMode              = AutoScaleMode.Font;
            ControlBox                 = true;
            Enabled                    = true;
            KeyPreview                 = false;
            MinimizeBox                = true;
            Cursor                     = Cursors.Default;
            RightToLeft                = RightToLeft.No;
            ShowInTaskbar              = true;
            HelpButton                 = false;
            WindowState                = FormWindowState.Normal;
            Name                       = "frmMultiColumnListBox";
            _lstItems.BackColor        = Color.White;
            _lstItems.Font             = new Font("MS 明朝", 12f, FontStyle.Regular, GraphicsUnit.Point, Conversions.ToByte(128));
            _lstItems.ForeColor        = Color.Black;
            _lstItems.Size             = new Size(654, 407);
            _lstItems.Location         = new Point(8, 8);
            _lstItems.TabIndex         = 0;
            _lstItems.BorderStyle      = BorderStyle.Fixed3D;
            _lstItems.CausesValidation = true;
            _lstItems.Enabled          = true;
            _lstItems.IntegralHeight   = true;
            _lstItems.Cursor           = Cursors.Default;
            _lstItems.SelectionMode    = SelectionMode.One;
            _lstItems.RightToLeft      = RightToLeft.No;
            _lstItems.Sorted           = false;
            _lstItems.TabStop          = true;
            _lstItems.Visible          = true;
            _lstItems.MultiColumn      = true;
            _lstItems.ColumnWidth      = 164;
            _lstItems.Name             = "_lstItems";
            labCaption.BackColor       = Color.White;
            labCaption.Font            = new Font("MS 明朝", 12f, FontStyle.Regular, GraphicsUnit.Point, Conversions.ToByte(128));
            labCaption.ForeColor       = Color.Black;
            labCaption.Size            = new Size(654, 23);
            labCaption.Location        = new Point(8, 416);
            labCaption.TabIndex        = 1;
            labCaption.TextAlign       = ContentAlignment.TopLeft;
            labCaption.Enabled         = true;
            labCaption.Cursor          = Cursors.Default;
            labCaption.RightToLeft     = RightToLeft.No;
            labCaption.UseMnemonic     = true;
            labCaption.Visible         = true;
            labCaption.AutoSize        = false;
            labCaption.BorderStyle     = BorderStyle.Fixed3D;
            labCaption.Name            = "labCaption";
            Controls.Add(_lstItems);
            Controls.Add(labCaption);
            Activated  += new EventHandler(frmMultiColumnListBox_Activated);
            Load       += new EventHandler(frmMultiColumnListBox_Load);
            FormClosed += new FormClosedEventHandler(frmMultiColumnListBox_FormClosed);
            MouseDown  += new MouseEventHandler(frmMultiColumnListBox_MouseDown);
            ResumeLayout(false);
            PerformLayout();
        }
Beispiel #2
0
        // 地形効果を追加
        public void AddFeature(ref string fdef)
        {
            FeatureData fd;
            string      ftype, fdata = default;
            double      flevel;
            short       i, j;
            string      buf;

            if (colFeature is null)
            {
                colFeature = new Collection();
            }

            buf = fdef;

            // 地形効果の種類、レベル、データを切り出し
            flevel = SRC.DEFAULT_LEVEL;
            i      = (short)Strings.InStr(buf, "Lv");
            j      = (short)Strings.InStr(buf, "=");
            if (i > 0 & j > 0 & i > j)
            {
                i = 0;
            }

            if (i > 0)
            {
                ftype = Strings.Left(buf, i - 1);
                if (j > 0)
                {
                    flevel = Conversions.ToDouble(Strings.Mid(buf, i + 2, j - (i + 2)));
                    fdata  = Strings.Mid(buf, j + 1);
                }
                else
                {
                    flevel = Conversions.ToDouble(Strings.Mid(buf, i + 2));
                }
            }
            else if (j > 0)
            {
                ftype = Strings.Left(buf, j - 1);
                fdata = Strings.Mid(buf, j + 1);
            }
            else
            {
                ftype = buf;
            }

            // 地形効果を登録
            fd         = new FeatureData();
            fd.Name    = ftype;
            fd.Level   = flevel;
            fd.StrData = fdata;
            if (IsFeatureAvailable(ref ftype))
            {
                colFeature.Add(fd, ftype + Microsoft.VisualBasic.Compatibility.VB6.Support.Format(CountFeature()));
            }
            else
            {
                colFeature.Add(fd, ftype);
            }
        }