当前位置: 首页>>代码示例>>C#>>正文


C# PictureBox.BringToFront方法代码示例

本文整理汇总了C#中System.Windows.Forms.PictureBox.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# PictureBox.BringToFront方法的具体用法?C# PictureBox.BringToFront怎么用?C# PictureBox.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.PictureBox的用法示例。


在下文中一共展示了PictureBox.BringToFront方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize_Form

 public void Initialize_Form()
 {
     #region main controls
     transBox = new PictureBox();
     transBox.Size = new Size(1000, 1000);
     transBox.Location = new Point(-0, -150);
     transBox.BackColor = Color.FromArgb(32,32,32);
     transBox.BringToFront();
     transBox.Visible = true;
     this.Controls.Add(transBox);
     transBox.BringToFront();
     this.Location = new Point(500, 200);
     InitializeComponent();
     #endregion 
 }        
开发者ID:sanducezar94,项目名称:CSharp-Data-Management-DEMO-,代码行数:15,代码来源:Main_Form.cs

示例2: Joueur

        private int totalPoint; // le score du joueur

        #endregion Fields

        #region Constructors

        // constructeur, on recoit le panel, le point de départ dans le panel et si le joueur est le premier ou le deuxieme
        public Joueur(Panel panel, Point loc, bool j1)
        {
            pBJoueur = new PictureBox(); // on instencie le pB du joueur
            pBJoueur.Location = loc;    // on place le joueur a la bonne position dans le panel
            pBJoueur.BackColor = Color.Transparent; // Astuce pour avoir un fond transparent avec un bitmap. La couleur de fond est transparente
            Bitmap vaisseau;
            if (j1)                 // Si c'est le joueur 1 alors il sera blanc. On choisi un pixel ( dans un des coins) dont la couleur correspondra au transparent
            {
                joueur1 = true;     // variable pour les animations (pas avoir de changement de couleurs lors du changement d'image)
                vaisseau = new Bitmap(@".\vaisseau.bmp");
                vaisseau.MakeTransparent((vaisseau.GetPixel(0, vaisseau.Size.Height - 1)));
            }                       // si c'est le joueur 2
            else
            {
                joueur1 = false;
                vaisseau = new Bitmap(@".\vaisseau2.bmp");
                vaisseau.MakeTransparent((vaisseau.GetPixel(0, vaisseau.Size.Height - 1)));
            }
            pBJoueur.Size = new Size(50, 50); // on donne la taille au pB
            pBJoueur.Image = vaisseau; // On donne au pB l'image
            pBJoueur.BringToFront();    // On met le pB au premier plan pour éviter des recouvrements
            this.panelFond = panel;     // On met le panel recu dans une des variables pour éviter de devoir faire des envois intempestifs
            panelFond.Controls.Add(pBJoueur); // on ajoute le joueur au controle du panel (pour qu'on ne voie pas le gros carré noir)
            pBJoueur.Refresh(); // Pour etre certain que l'image est bien présente dans le pB
            totalPoint = 0; // on mets son score a 0
            combo = 1000;   // On rempli sa jauge de super tir
        }
开发者ID:Boucquey,项目名称:projetInfo,代码行数:34,代码来源:Joueur.cs

示例3: addPB

 private void addPB(PictureBox i_picturebox, int i_top, int i_left)
 {
     i_picturebox.Top = i_top;
     i_picturebox.Left = i_left;
     i_picturebox.BringToFront();
     m_txtBox.FindForm().Controls.Add(i_picturebox);
 }
开发者ID:nguyendanhtu,项目名称:bki-quan-ly-du-toan,代码行数:7,代码来源:CErrorTextBoxHanler.cs

示例4: Abeja

        public PictureBox Abeja()
        {
            PictureBox bee = new PictureBox();
            bee.BackgroundImage = global::SimulacionAbejasHilos.Properties.Resources.Bee;
            bee.BackColor = System.Drawing.Color.Transparent;
            bee.BackgroundImage.RotateFlip(RotateFlipType.Rotate180FlipNone);
            bee.Location = new System.Drawing.Point(68, 114);
            bee.Size = new System.Drawing.Size(25, 22);
            bee.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
            bee.BringToFront();

            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(
                    delegate()
                    {
                        this.Controls.Add(bee);
                    }
                    ));
            }
            else
            {
                this.Controls.Add(bee);
            }

            return bee;
        }
开发者ID:hornetusaf,项目名称:Bees-and-threads,代码行数:27,代码来源:Form1.cs

示例5: Freeze

        // freeze the form
        public void Freeze()
        {
            // Remember we have frozen the form once more
            // Do nothing if it was already frozen
            if (++FreezeCount > 1)
                return;

            Rectangle rect = form.ClientRectangle;
            if (rect.IsEmpty || form.WindowState == FormWindowState.Minimized)
                return;

            Point topLeft = form.PointToScreen(new Point(rect.Left, rect.Top));

            // Create a PictureBox that resizes with its contents
            pictureBox = new PictureBox();
            pictureBox.SizeMode = PictureBoxSizeMode.AutoSize;

            // create a bitmap as large as the form's client area and with same color depth
            using (Graphics frmGraphics = form.CreateGraphics()) {
                Bitmap bitmap = new Bitmap(rect.Width, rect.Height, frmGraphics);
                hBitmap = bitmap.GetHbitmap();
                pictureBox.Image = Image.FromHbitmap(hBitmap);
            }

            // copy the screen contents, from the form's client area to the hidden bitmap
            using (Graphics picGraphics = Graphics.FromImage(pictureBox.Image)) {
                picGraphics.CopyFromScreen(topLeft, Point.Empty, rect.Size, CopyPixelOperation.SourceCopy);
            }

            // Display the bitmap in the picture box, and show the picture box in front of all other controls
            form.Controls.Add(pictureBox);
            pictureBox.BringToFront();
        }
开发者ID:GiGatR00n,项目名称:AionParsers,代码行数:34,代码来源:FormFreezer.cs

示例6: dg_import_image_FileOk

 private void dg_import_image_FileOk(object sender, EventArgs e)
 {
     PictureBox pBox = new PictureBox();
     pBox.Image = Image.FromFile(this.dg_import_image.FileName);
     pBox.Size = pBox.Image.Size;
     pBox.Location = new Point((int)(0.5f * (this.Width - pBox.Size.Width)), (int)(0.5f * (this.Height - pBox.Size.Height)));
     //pBox.Click += new EventHandler(pBox_Click);
     pBox.DragDrop += new DragEventHandler(pBox_DragDrop);
     this.pBoxes.Add(pBox);
     this.Controls.Add(pBox);
     pBox.BringToFront();
 }
开发者ID:jwittzy,项目名称:mproject,代码行数:12,代码来源:Form1.cs

示例7: aboutToolStripMenuItem_Click

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PictureBox splashImage = new PictureBox();
            Form aboutFrm = new Form();
            aboutFrm.ClientSize = new System.Drawing.Size(600, 400);
            aboutFrm.Controls.Add(splashImage);

            splashImage.ClientSize = new System.Drawing.Size(600, 400);
            splashImage.BringToFront();
            splashImage.BackgroundImage = new Bitmap(MedTermsFlashCardApplication.Properties.Resources.Splash);
            splashImage.Show();
            aboutFrm.ShowDialog();
        }
开发者ID:rdafoe,项目名称:FlashCardsWin,代码行数:13,代码来源:Form1.cs

示例8: CreateTerrainSlice

 public void CreateTerrainSlice(int height, int x, int y)
 {
     y = playGround.Bottom - height; 
     PictureBox test = new PictureBox
     {
         Name = "pictureBox",
         Size = new Size(1, 1),
         Location = new Point(x, y),
         Visible = true,
         BackColor = Color.Black
     };
     test.Height = height;
     test.BringToFront();
     playGround.Controls.Add(test);
 }
开发者ID:AdamMartell,项目名称:Projects,代码行数:15,代码来源:Form1.cs

示例9: CreateTerrainSlice

 public static PictureBox CreateTerrainSlice(int height, int x, int y)
 {
     y = UI.playGround.Bottom - height;
     PictureBox slice = new PictureBox
     {
         Name = "pictureBox",
         Size = new Size(1, 1),
         Location = new Point(x, y),
         Visible = true,
         BackColor = Color.Black
     };
     slice.Height = height;
     slice.BringToFront();
     UI.playGround.Controls.Add(slice);
     return slice;
 }
开发者ID:AdamMartell,项目名称:Projects,代码行数:16,代码来源:Environment.cs

示例10: AddNPC

        void AddNPC(NPC npc)
        {
            // Add npc to the list
            NPCNameID nameID = Program.s_npcNameIDs[npc.GameID];
            ListViewItem lvi = lvNPCs.Items.Add(npc.ID.ToString() + ": " + nameID.ToString());
            lvi.Tag = npc;

            // Add npc to the map
            PictureBox pb = new PictureBox();
            SetMapMarkerRed(pb, npc);
            _mapMarkers.Add(pb);
            Controls.Add(pb);
            pb.BringToFront();
            pb.Tag = lvi;
            pb.MouseClick += Pb_MouseClick;
            pb.MouseMove += Pb_MouseMove;
        }
开发者ID:acid1789,项目名称:DecoServer2,代码行数:17,代码来源:NPCDialog.cs

示例11: AddLocation

        void AddLocation(Location loc)
        {
            // Add npc to the list
            ListViewItem lvi = lvLocations.Items.Add(loc.ID.ToString());
            lvi.SubItems.Add(loc.Name);
            lvi.Tag = loc;

            // Add npc to the map
            PictureBox pb = new PictureBox();
            SetMapMarkerDark(pb, loc);
            _mapMarkers.Add(pb);
            Controls.Add(pb);
            pb.BringToFront();
            pb.Tag = lvi;
            pb.MouseClick += Pb_MouseClick;
            pb.MouseMove += Pb_MouseMove;
        }
开发者ID:acid1789,项目名称:DecoServer2,代码行数:17,代码来源:Locations.cs

示例12: Enemi

 //Permet de créer un enemi en multijoueur du coté client. Le client recoit la coordonnée de l'apparition de l'enemi
 public Enemi(Panel panel, Point z, Boolean multi)
 {
     this.p.X = z.X;
     this.p.Y = z.Y;
     enemi = new PictureBox();
     Image vaisseau = Image.FromFile(@".\enemi1.png");
     enemi.Image = vaisseau;
     enemi.BringToFront();
     enemi.Height = 30;
     enemi.Width = 60;
     if (!multi)
     {
         enemi.BackColor = Color.Transparent;
     }
     enemi.Location = p;
     panel.Controls.Add(enemi);
     lives = 2;
 }
开发者ID:Boucquey,项目名称:projetInfo,代码行数:19,代码来源:Enemi.cs

示例13: PlayJpegsInBatchMode

        public PlayJpegsInBatchMode(APPLICATION_DATA appData, Panel parentPanel, Form parentForm, int chan)
        {
            m_AppData = appData;
            m_AppData.AddOnClosing(OnStop, APPLICATION_DATA.CLOSE_ORDER.FIRST);
            m_Log = (ErrorLog)m_AppData.Logger;

            m_AppData.DVRMode = APPLICATION_DATA.DVR_MODE.STORE_ON_PLATE_FOUND; // need this set for LPR to not consolidate multiple video frames

            m_Channel = chan;
            m_ParentForm = parentForm;
            m_ParentPanel = parentPanel;

            m_DisplayImagePB = new PictureBox();
            m_DisplayImagePB.SizeMode = PictureBoxSizeMode.StretchImage;
            m_DisplayImagePB.BackColor = Color.Black;
            m_DisplayImagePB.Size = m_ParentPanel.Size;

            m_ParentPanel.Controls.Add(m_DisplayImagePB);
            m_DisplayImagePB.BringToFront();
        }
开发者ID:anndream,项目名称:anpr-1,代码行数:20,代码来源:PlayJpegsInBatchMode.cs

示例14: TerrainDisplay

        public TerrainDisplay(TerrainTile[,] tiles)
        {
            mode = Mode.Erase;
            this.tilesBak = (TerrainTile[,])tiles.Clone();
            this.tiles = tiles;
            ClientSize = new Size(800, 800);
            BackColor = Color.Blue;
            WindowState = FormWindowState.Maximized;
            panel = new Panel()
            {
                Dock = DockStyle.Fill,
                AutoScroll = true,
                Controls =
                {
                    (pic = new PictureBox()
                    {
                        Image = bmp = RenderColorBmp(tiles),
                        SizeMode = PictureBoxSizeMode.AutoSize,
                    })
                }
            };
            panel.HorizontalScroll.Enabled = true;
            panel.VerticalScroll.Enabled = true;
            panel.HorizontalScroll.Visible = true;
            panel.VerticalScroll.Visible = true;
            Controls.Add(panel);
            pic2 = new PictureBox()
            {
                Image = bmp,
                Width = 250,
                Height = 250,
                SizeMode = PictureBoxSizeMode.Zoom
            };
            Controls.Add(pic2);
            pic2.BringToFront();

            Text = mode.ToString();

            pic.MouseMove += new MouseEventHandler(pic_MouseMove);
            pic.MouseDoubleClick += new MouseEventHandler(pic_MouseDoubleClick);
        }
开发者ID:xzyio,项目名称:Rotmg-PServer,代码行数:41,代码来源:TerrainDisplay.cs

示例15: AddTriangle

        // Fenêtre Settings Général
        private void AddTriangle(Button sender)
        {
            PictureBox PB = new PictureBox();
            PB.Name = "PB_triangle";
            PB.BackgroundImage = new Bitmap(ChangeImageColor_GetPixel("triangle"));
            PB.Size = new Size(12, 31);
            PB.BackColor = Color.White;
            PB.SizeMode = PictureBoxSizeMode.Zoom;

            int pX;
            if (sender.Location.X < this.Width / 2)
                pX = sender.Width;
            else
            {
                pX = this.Width - sender.Width - PB.Width - 16;
                PB.BackgroundImage.RotateFlip(RotateFlipType.Rotate180FlipNone);
            }
            PB.Location = new Point(pX, 35);

            Controls.Add(PB);
            PB.BringToFront();
        }
开发者ID:Maelstrom96,项目名称:ClubVideo,代码行数:23,代码来源:User_Settings.cs


注:本文中的System.Windows.Forms.PictureBox.BringToFront方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。