Avatar billede nielsbrinch Nybegynder
23. oktober 2003 - 10:47 Der er 1 løsning

Den ene ListBox overlapper den anden

Jeg har to ListBox'e ved siden af hinanden. Den ene er docked til venstre og den anden er docked med "fill". Den med "fill" er konsekvent inde bagved den til venstre, så en del af den er skjult. Hvad gør jeg for at forhindre dette.
Avatar billede finger Nybegynder
23. oktober 2003 - 11:17 #1
højreklik på den der er filled og tryk brig to front:
-----

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WindowsApplication1
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public class Form1 : System.Windows.Forms.Form
    {
        private System.Windows.Forms.ListBox listBoxfill;
        private System.Windows.Forms.ListBox listBoxleft;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.listBoxfill = new System.Windows.Forms.ListBox();
            this.listBoxleft = new System.Windows.Forms.ListBox();
            this.SuspendLayout();
            //
            // listBoxfill
            //
            this.listBoxfill.Dock = System.Windows.Forms.DockStyle.Fill;
            this.listBoxfill.Location = new System.Drawing.Point(120, 0);
            this.listBoxfill.Name = "listBoxfill";
            this.listBoxfill.Size = new System.Drawing.Size(600, 446);
            this.listBoxfill.TabIndex = 0;
            //
            // listBoxleft
            //
            this.listBoxleft.Dock = System.Windows.Forms.DockStyle.Left;
            this.listBoxleft.Location = new System.Drawing.Point(0, 0);
            this.listBoxleft.Name = "listBoxleft";
            this.listBoxleft.Size = new System.Drawing.Size(120, 446);
            this.listBoxleft.TabIndex = 1;
            this.listBoxleft.SelectedIndexChanged += new System.EventHandler(this.listBox2_SelectedIndexChanged);
            //
            // Form1
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(720, 446);
            this.Controls.Add(this.listBoxfill);
            this.Controls.Add(this.listBoxleft);
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);

        }
        #endregion

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.Run(new Form1());
        }

        private void listBox2_SelectedIndexChanged(object sender, System.EventArgs e)
        {
       
        }
    }
}
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester