المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Runtime ToFront toBack?



C# Programming
12-19-2009, 05:30 AM
I've made a picturebox where I have a runtime code in. There i open a other Picturebox, but that picturebox I run runtime from the Design Picturebox is under the design picturebox and must be at the top. Hope somebody can help.

Dennis,

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace KVzoekscherm
{
public partial class runtimeobject : Form
{
Button button1;
Button button2;
Bitmap image1;
PictureBox pictureBox1;

public runtimeobject()
{
InitializeComponent();
}

//Deze functie roept hij op wanneer hij over de (grote) picturebox gaat
private void pbMaak_Click(object sender, EventArgs e)
{
pictureBox1 = new PictureBox();
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBox1.BorderStyle = BorderStyle.None;
pictureBox1.ClientSize = new Size(15, 15);
pictureBox1.******** = new System.Drawing.Point(50, 50);
pictureBox1.Cursor = Cursors.Hand;
pictureBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
pictureBox1.TabIndex = 28;

image1 = new Bitmap(Properties.Resources.edit_gray);
pictureBox1.Image = (Image)image1;

pictureBox1.Click += new EventHandler(editclick);
pictureBox1.MouseLeave += new EventHandler(editleave);
pictureBox1.MouseEnter += new EventHandler(editenter);
this.Controls.Add(pictureBox1);
}

private void editenter(object sender, EventArgs e)
{
image1 = new Bitmap(Properties.Resources.edit_color);
pictureBox1.Image = (Image)image1;
}

private void editleave(object sender, EventArgs e)
{
image1 = new Bitmap(Properties.Resources.edit_gray);
pictureBox1.Image = (Image)image1;
}

private void editclick(object sender, EventArgs e)
{
MessageBox.Show("Clicked");
}

private void runtimeobject_Load(object sender, EventArgs e)
{

}

private void pbMaak_Click_1(object sender, EventArgs e)
{

}
}
}