c# pointers

A need help and hope someone here can help me!!

A long time ago I used c++ and used pointer but now moved over to c# and havent programmed for a while! my problem is:

I have a picturebox that contains a number of rich text boxes (dont ask why!! :D ) what I want to do is enable bold on all of the richtextboxes with only using reference to the picture box (called pbxContainer )

this is all the code I have written before a blank:

private void bold(PictureBox pbx)

{

int count = 0;

while (pbx.Controls.Count > count)

{

//need code here

count++

}

}

what I wish the while loop to do is go through all the richtextbox controls within pbx and turn the option of bold on. I hope someone can help me!! and if you need anymore information I will provide!



Answer this question

c# pointers

  • TylerH

    By the way, a controls font property is immutable.

    You will have to construct a font with properties and then set the controls font property to the newly instanced font class.



  • KirHil

    Thanks alot! saved me alot of work.
  • sledge

    foreach(SomeControlType ctrl in myContainer.Controls)

       ctrl.DesiredProperty = desiredValue;



  • c# pointers