public PicDetailElement(Form parent, ToolTip tooltip = null)
        {
            InitializeComponent();

            this.BackColor      = Color.GhostWhite;
            this.parent         = parent;
            this.DoubleBuffered = true;

            Disposed += OnDispose;

            //
            //  PictureBox to VUI
            //
            vuiPB                 = new VUI.VUIPictureBox();
            vuiPB.Size            = new Size(150, 200);
            vuiPB.Location        = pb.Location;
            vuiPB.MouseEnterEvent = () => { info.Value.Location = Cursor.Position; info.Value.Show(); };
            vuiPB.MouseLeaveEvent = () => { info.Value.Location = Cursor.Position; info.Value.Hide(); };
            vuiPB.MouseMoveEvent  = () => {
                int sw = SystemInformation.VirtualScreen.Width;
                int sh = SystemInformation.VirtualScreen.Height;
                int cx = Cursor.Position.X + 15;
                int cy = Cursor.Position.Y;
                if (sw < cx - 15 + info.Value.Width)
                {
                    cx = Cursor.Position.X - 15 - info.Value.Width;
                }
                if (sh < info.Value.Height + cy)
                {
                    cy = sh - info.Value.Height;
                }
                info.Value.Location = new Point(cx, cy);
            };
            pb.Dispose();

            //
            // Button to VUI
            //
            //for (int i = 0; i < Controls.Count; i++)
            //{
            //    if (Controls[i] is Button)
            //    {
            //        using (Button bbb = Controls[i] as Button)
            //        {
            //            VUI.VUIButton button = new VUI.VUIButton();
            //            button.Location = (Controls[i] as Button).Location;
            //            button.Size = (Controls[i] as Button).Size;
            //            button.Font = (Controls[i] as Button).Font;
            //            button.Text = (Controls[i] as Button).Text;
            //            (Controls[i--] as Button).Dispose();
            //            vuiButtons.Add(button);
            //        }
            //    }
            //}
        }
Exemplo n.º 2
0
        public PicDetailElement(Form parent, ToolTip tooltip = null)
        {
            InitializeComponent();

            this.BackColor      = Color.GhostWhite;
            this.parent         = parent;
            this.DoubleBuffered = true;

            Disposed += OnDispose;

            //
            //  PictureBox to VUI
            //
            vuiPB                 = new VUI.VUIPictureBox();
            vuiPB.Size            = new Size(150, 200);
            vuiPB.Location        = pb.Location;
            vuiPB.MouseEnterEvent = () => { info.Value.Location = Cursor.Position; info.Value.Show(); };
            vuiPB.MouseLeaveEvent = () => { info.Value.Location = Cursor.Position; info.Value.Hide(); };
            vuiPB.MouseMoveEvent  = () => { info.Value.Location = new Point(Cursor.Position.X + 15, Cursor.Position.Y); };
            pb.Dispose();

            //
            // Button to VUI
            //
            //for (int i = 0; i < Controls.Count; i++)
            //{
            //    if (Controls[i] is Button)
            //    {
            //        using (Button bbb = Controls[i] as Button)
            //        {
            //            VUI.VUIButton button = new VUI.VUIButton();
            //            button.Location = (Controls[i] as Button).Location;
            //            button.Size = (Controls[i] as Button).Size;
            //            button.Font = (Controls[i] as Button).Font;
            //            button.Text = (Controls[i] as Button).Text;
            //            (Controls[i--] as Button).Dispose();
            //            vuiButtons.Add(button);
            //        }
            //    }
            //}
        }
Exemplo n.º 3
0
        public PicDetailElement(Form parent, ToolTip tooltip = null)
        {
            InitializeComponent();

            this.BackColor      = Color.GhostWhite;
            this.parent         = parent;
            this.DoubleBuffered = true;

            Disposed += OnDispose;

            //
            //  PictureBox to VUI
            //
            vuiPB                 = new VUI.VUIPictureBox();
            vuiPB.Size            = new Size(150, 200);
            vuiPB.Location        = pb.Location;
            vuiPB.MouseEnterEvent = () => { if (info != null)
                                            {
                                                info.Value.Location = Cursor.Position; info.Value.Show();
                                            }
            };
            vuiPB.MouseLeaveEvent = () => { if (info != null)
                                            {
                                                info.Value.Location = Cursor.Position; info.Value.Hide();
                                            }
            };
            vuiPB.MouseMoveEvent = () => {
                if (info != null)
                {
                    int sw = SystemInformation.VirtualScreen.Width;
                    int sh = SystemInformation.VirtualScreen.Height;
                    int cx = Cursor.Position.X + 15;
                    int cy = Cursor.Position.Y;
                    if (sw < cx - 15 + info.Value.Width)
                    {
                        cx = Cursor.Position.X - 15 - info.Value.Width;
                    }
                    if (sh < info.Value.Height + cy)
                    {
                        cy = sh - info.Value.Height;
                    }
                    info.Value.Location = new Point(cx, cy);
                }
            };
            pb.Dispose();

            //
            // Button to VUI
            //
            //for (int i = 0; i < Controls.Count; i++)
            //{
            //    if (Controls[i] is Button)
            //    {
            //        using (Button bbb = Controls[i] as Button)
            //        {
            //            VUI.VUIButton button = new VUI.VUIButton();
            //            button.Location = (Controls[i] as Button).Location;
            //            button.Size = (Controls[i] as Button).Size;
            //            button.Font = (Controls[i] as Button).Font;
            //            button.Text = (Controls[i] as Button).Text;
            //            (Controls[i--] as Button).Dispose();
            //            vuiButtons.Add(button);
            //        }
            //    }
            //}

            //https://stackoverflow.com/questions/5489273/how-do-i-disable-the-horizontal-scrollbar-in-a-panel=
            flowLayoutPanel1.AutoScroll = true;
            flowLayoutPanel1.HorizontalScroll.Enabled = false;
            flowLayoutPanel1.HorizontalScroll.Visible = false;
        }