Example #1
0
        public VwXls() {
            InitializeComponent();

            {
                FlowLayoutPanel flp = flperr = new FlowLayoutPanel();
                flp.Hide();
                flp.Dock = DockStyle.Fill;
                {
                    PictureBox pb = new PictureBox();
                    pb.Image = Resources.eventlogError.ToBitmap();
                    pb.SizeMode = PictureBoxSizeMode.AutoSize;
                    flp.Controls.Add(pb);
                }
                {
                    Label la = laerr1 = new Label();
                    la.AutoSize = true;
                    flp.Controls.Add(la);
                    flp.SetFlowBreak(la, true);
                }
                {
                    Label la = laerr2 = new Label();
                    la.AutoSize = true;
                    flp.Controls.Add(la);
                }
                flp.Parent = this;
            }

            {
                TableLayoutPanel p = flpwip = new TableLayoutPanel();
                p.Hide();
                p.Dock = DockStyle.Fill;
                p.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
                p.RowStyles.Add(new RowStyle(SizeType.AutoSize));
                {
                    FlowLayoutPanel flp = new FlowLayoutPanel();
                    flp.Anchor = AnchorStyles.None;
                    flp.AutoSize = true;
                    flp.AutoSizeMode = AutoSizeMode.GrowAndShrink;
                    flp.BackColor = Color.WhiteSmoke;
                    flp.ForeColor = Color.Black;
                    {
                        Label la = lawip = new Label();
                        la.AutoSize = true;
                        flp.Controls.Add(la);
                        flp.SetFlowBreak(la, true);
                    }
                    {
                        ProgressBar pb = new ProgressBar();
                        pb.Style = ProgressBarStyle.Marquee;
                        flp.Controls.Add(pb);
                    }
                    p.Controls.Add(flp);
                    flp.Show();
                }
                p.Parent = this;
            }

            Sync = SynchronizationContext.Current;
        }
        private void addProgressBarToTheWindow()
        {
            FlowLayoutPanel f = new FlowLayoutPanel();
            f.Size = new Size(5400, 30);
            f.FlowDirection = FlowDirection.LeftToRight;
            f.WrapContents = true;

            f.HorizontalScroll.Visible = true;
            f.VerticalScroll.Maximum = 0;

            f.AutoScroll = true;

            ProgressBar p = new ProgressBar();
            p.Size = new Size(420, 24);
            p.Maximum = 100;
            p.Minimum = 0;
            //            p.Location = new Point(0, 0);
            p.Value = 60;
            p.Visible = true;

            //            p.Show();

            f.Controls.Add(p);

            Label l = new Label();

            l.Text = p.Value.ToString() + "%";// +"vbdfkjvdfkjlvdfvdfbdkj.avi";
            l.Visible = true;
            l.Size = new Size(300, 24);
            //  l.Location = new Point(120, 0);

            f.Controls.Add(l);

            f.Show();

            ProgressBars.Controls.Add(f);
        }
        private void addProgressBarToTheWindow(FlowLayoutPanel progressBar)
        {
            FlowLayoutPanel f = new FlowLayoutPanel();
            f.Size = new Size(5400, 30);
            f.FlowDirection = FlowDirection.LeftToRight;
            f.WrapContents = true;

            f.HorizontalScroll.Visible = true;
            f.VerticalScroll.Maximum = 0;

            f.AutoScroll = true;

            ProgressBar p = new ProgressBar();
            p.Size = new Size(420, 24);
            p.Maximum = 100;
            p.Minimum = 0;
            p.Value = 60;
            p.Visible = true;

            f.Controls.Add(p);

            Label l = new Label();

            l.Text = _name + " " + p.Value.ToString() + "%";
            l.Visible = true;
            l.Size = new Size(300, 24);

            f.Controls.Add(l);
            f.Show();

            progressBar.Controls.Add(f);
        }