Ejemplo n.º 1
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            OutsidePanel panel = (OutsidePanel)listBox1.SelectedItem;

            if (panel != null)
            {
                textBoxInfo.Text = panel.Info;
            }
        }
Ejemplo n.º 2
0
        private void ZoomBlock(object sender, EventArgs e)
        {
            OutsidePanel panel = (OutsidePanel)listBox1.SelectedItem;

            if (panel != null)
            {
                Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
                ed.Zoom(panel.Extents);
            }
        }
Ejemplo n.º 3
0
        private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
        {
            Brush        color = Brushes.Black;
            OutsidePanel panel = (OutsidePanel)listBox1.Items[e.Index];

            if (panel != null)
            {
                e.DrawBackground();
                switch (panel.DbStatus)
                {
                case DB.EnumBaseStatus.Ok:
                    color = Brushes.Blue;
                    break;

                case DB.EnumBaseStatus.NotFound:
                    color = Brushes.Red;
                    break;
                }
                e.Graphics.DrawString(panel.ToString(), ((Control)sender).Font, color, e.Bounds.X, e.Bounds.Y);
            }
        }