Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

only draw text in first box 1

Status
Not open for further replies.

clowns119

Programmer
Feb 20, 2005
15
US
Hi all I have a loop that draws rectangles and I want to draw text only on the first box in the loop. How can I do this, here is my code. It draws the text in each box but I only want it to be in the first box, please help! thanks
Code:
For x = ((SZL1val+12) mod 24) To ((SZL2val+12) mod 24) : szlboxes1(x) = New Rectangle(20+((35*(X+1))), 55, 35, 25)
       	g.DrawString(SZLWXTXT1, New Font("Veranda",7,FontStyle.BOLD),Brushes.Black,new RectangleF(20+((35*(X+1))), 55, 35, 25))
       	Next x
 
Ok, but what do I put as my g.drawstring rectanglef coords to make them go over the first box only.
 
i tried

Code:
       	if x=((SZL1val+12) mod 24) then g.DrawString(SZLWXTXT1, New Font("Veranda",7,FontStyle.BOLD),Brushes.Black,New RectangleF(20, 55, 35, 25))
and it did not work
 
if I do a if statement do I have to have 24 diffrent else if's? or can I do a for statement for my points of the drawstring so the drawstring will appear on top on SZL1VAL?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top