private void toolStripButton5_Click(object sender, EventArgs e) { /* # The cubicles are created using this method and they are created dynamically using array. the maximum size of the array is declared in the top */ cubPic[q] = new CustomPictureBox(); cubPic[q].Size = new Size(100, 100); //I use this picturebox simply to debug and see if I can create a single picturebox, and that way I can tell if something goes wrong with my array of pictureboxes. Thus far however, neither are working. cubPic[q].Dock = DockStyle.Top; cubPic[q].SizeMode = PictureBoxSizeMode.Normal; cubPic[q].BackColor = Color.LightSkyBlue; cubPic[q].BorderStyle = BorderStyle.Fixed3D; cubPic[q].Anchor = AnchorStyles.Top; cubPic[q].BackgroundImageLayout = ImageLayout.Stretch; cubPic[q].Location = new Point(0, 0); cubPic[q].MouseDown += new MouseEventHandler(cubPic_MouseDown); cubPic[q].MouseUp += new MouseEventHandler(cubPic_MouseUp); cubPic[q].MouseMove += new MouseEventHandler(cubPic_MouseMove); cubPic[q].MouseHover += new EventHandler(cubPic_MouseHover); cubPic[q].MouseDoubleClick += new MouseEventHandler(cubPic_MouseDoubleClick); cubPic[q].DragOver += new DragEventHandler(cubPic_DragOver); cubPic[q].DragDrop += new DragEventHandler(cubPic_DragDrop); // cubPic[q].Tag = q; this.cubPic[q].AllowDrop = true; cubPic[q].Anchor = AnchorStyles.Top; cubPic[q].SendToBack(); cubPic[q].Visible = true; BaseMap.Controls.Add(cubPic[q]); q++; }
public Res() { InitializeComponent(); BaseMap.SendToBack(); for (int i = 0; i < 50; i++) { resPic[i] = new ResourcePictureBox(); cubPic[i] = new CustomPictureBox(); //pictureBox1.Paint += new PaintEventHandler(panelArea_Paint); } }
private void createCubicle(string tagNo, string Locationx, string Locationy, string height, string width, string C_Name, string CubNo, string EmpName, string EmpSno, string C_State, string Other) { int Height = Int32.Parse(height); int Width = Int32.Parse(width); int TagNo = Int32.Parse(tagNo); int LocationX = Int32.Parse(Locationx); int LocationY = Int32.Parse(Locationy); cubPic[TagNo] = new CustomPictureBox(); cubPic[TagNo].Size = new Size(Width, Height); //I use this picturebox simply to debug and see if I can create a single picturebox, and that way I can tell if something goes wrong with my array of pictureboxes. Thus far however, neither are working. cubPic[TagNo].Dock = DockStyle.Top; cubPic[TagNo].SizeMode = PictureBoxSizeMode.Normal; cubPic[TagNo].BackColor = Color.LightSkyBlue; cubPic[TagNo].BorderStyle = BorderStyle.Fixed3D; cubPic[TagNo].Anchor = AnchorStyles.Top; cubPic[TagNo].BackgroundImageLayout = ImageLayout.Stretch; cubPic[TagNo].MouseDown += new MouseEventHandler(cubPic_MouseDown); cubPic[TagNo].MouseUp += new MouseEventHandler(cubPic_MouseUp); cubPic[TagNo].MouseMove += new MouseEventHandler(cubPic_MouseMove); cubPic[TagNo].MouseHover += new EventHandler(cubPic_MouseHover); cubPic[TagNo].MouseDoubleClick += new MouseEventHandler(cubPic_MouseDoubleClick); cubPic[TagNo].DragOver += new DragEventHandler(cubPic_DragOver); cubPic[TagNo].DragDrop += new DragEventHandler(cubPic_DragDrop); // cubPic[TagNo].Tag = TagNo; this.cubPic[TagNo].AllowDrop = true; cubPic[TagNo].Anchor = AnchorStyles.Top; cubPic[TagNo].SendToBack(); cubPic[TagNo].Visible = true; BaseMap.Controls.Add(cubPic[TagNo]); cubPic[TagNo].Location = new Point(LocationX, LocationY); //Attributes of the cubicles cubPic[TagNo].C_Name = C_Name; cubPic[TagNo].CubNo = CubNo; cubPic[TagNo].EmpName = EmpName; cubPic[TagNo].EmpSno = EmpSno; cubPic[TagNo].C_State = C_State; cubPic[TagNo].Other = Other; q++; }