Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i am trying to place a label on a GDI circle, and move it along the screen on the circle. the circle is a graphical representation of a person. here is how i create a label for each person:

 

lab = new Label[People.Count];
		foreach(Person p in People)
		{
			p.People = this.People;
			int sad = this.People.IndexOf(p);
			//labels[People.IndexOf(p)] = new Label();
			lab[People.IndexOf(p)] = new Label();
			
		}	

 

 

 

when i update the circles position, i draw the label like this:

 

foreach(Person p in People)
		{
                               p.update();
			p.DrawToScreen(f.Graphics);
//				Label label = (Label)labels[People.IndexOf(p)-1];
//				label.Location = new System.Drawing.Point((int)p.position.Xval,(int)p.position.Yval);
//				label.Text = p.idNum.ToString();
			//p.UpdatePos();
			Label label = (Label)lab[People.IndexOf(p)];
			label.Location = new System.Drawing.Point((int)p.position.Xval,(int)p.position.Yval);
			float size = label.Font.Size;
			label.Text = p.idNum.ToString();
			label.Text = "test";
			label.Show();
			label.Refresh();
		}
		this.Invalidate();

 

my problem is that the label never shows up on screen. any suggestions?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...