locked
Position label in pictureBox RRS feed

  • Question

  • I am adding a label to a pictureBox with the following code...

     

    Label objId;

    objId = new Label();

    objId.BackColor = Color.Transparent;

    objId.ForeColor = Color.Blue;

    objId.Font = new Font(objId.Font.FontFamily, 22, objId.Font.Style);

    objId.Text = "TEST";

    pictureBox1.Controls.Add(objId);

     

    Problem is, it is at the top left of the picture box.

    How can I position this - the x,y coords - properly where I need it?

    Thanks,

    Zath

    Wednesday, March 22, 2006 2:31 PM

Answers

  • Nevermind, I found it.

    The left and top did the trick.

    objId.Left = 33;

    Zath

    Wednesday, March 22, 2006 2:36 PM